summaryrefslogtreecommitdiff
path: root/drivers/hwmon/max1111.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-04-04 09:51:08 (GMT)
committerTakashi Iwai <tiwai@suse.de>2016-04-04 09:51:08 (GMT)
commita99e31512aa435e8391ba5f5e64abeac9c5f2f32 (patch)
tree56bb9d9ccfe76520b672249757e25f686275b204 /drivers/hwmon/max1111.c
parent86c8dd7f4da3fb3f92fc5ab5144c971639d39745 (diff)
parentf03b24a851d32ca85dacab01785b24a7ee717d37 (diff)
downloadlinux-a99e31512aa435e8391ba5f5e64abeac9c5f2f32.tar.xz
Merge branch 'for-linus' into for-next
Conflicts: sound/hda/hdac_i915.c Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'drivers/hwmon/max1111.c')
-rw-r--r--drivers/hwmon/max1111.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hwmon/max1111.c b/drivers/hwmon/max1111.c
index 36544c4..303d0c9 100644
--- a/drivers/hwmon/max1111.c
+++ b/drivers/hwmon/max1111.c
@@ -85,6 +85,9 @@ static struct max1111_data *the_max1111;
int max1111_read_channel(int channel)
{
+ if (!the_max1111 || !the_max1111->spi)
+ return -ENODEV;
+
return max1111_read(&the_max1111->spi->dev, channel);
}
EXPORT_SYMBOL(max1111_read_channel);
@@ -258,6 +261,9 @@ static int max1111_remove(struct spi_device *spi)
{
struct max1111_data *data = spi_get_drvdata(spi);
+#ifdef CONFIG_SHARPSL_PM
+ the_max1111 = NULL;
+#endif
hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&spi->dev.kobj, &max1110_attr_group);
sysfs_remove_group(&spi->dev.kobj, &max1111_attr_group);