diff options
| -rw-r--r-- | drivers/hwmon/hwmon.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index 971c9eb78e6a..a0b5becf91fa 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c | |||
| @@ -559,7 +559,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, | |||
| 559 | 559 | ||
| 560 | hdev = &hwdev->dev; | 560 | hdev = &hwdev->dev; |
| 561 | 561 | ||
| 562 | if (chip && chip->ops->is_visible) { | 562 | if (chip) { |
| 563 | struct attribute **attrs; | 563 | struct attribute **attrs; |
| 564 | int ngroups = 2; | 564 | int ngroups = 2; |
| 565 | 565 | ||
| @@ -605,7 +605,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, | |||
| 605 | if (err) | 605 | if (err) |
| 606 | goto free_hwmon; | 606 | goto free_hwmon; |
| 607 | 607 | ||
| 608 | if (chip && chip->ops->is_visible && chip->ops->read && | 608 | if (chip && chip->ops->read && |
| 609 | chip->info[0]->type == hwmon_chip && | 609 | chip->info[0]->type == hwmon_chip && |
| 610 | (chip->info[0]->config[0] & HWMON_C_REGISTER_TZ)) { | 610 | (chip->info[0]->config[0] & HWMON_C_REGISTER_TZ)) { |
| 611 | const struct hwmon_channel_info **info = chip->info; | 611 | const struct hwmon_channel_info **info = chip->info; |
| @@ -673,7 +673,7 @@ hwmon_device_register_with_info(struct device *dev, const char *name, | |||
| 673 | const struct hwmon_chip_info *chip, | 673 | const struct hwmon_chip_info *chip, |
| 674 | const struct attribute_group **groups) | 674 | const struct attribute_group **groups) |
| 675 | { | 675 | { |
| 676 | if (chip && (!chip->ops || !chip->info)) | 676 | if (chip && (!chip->ops || !chip->ops->is_visible || !chip->info)) |
| 677 | return ERR_PTR(-EINVAL); | 677 | return ERR_PTR(-EINVAL); |
| 678 | 678 | ||
| 679 | return __hwmon_device_register(dev, name, drvdata, chip, groups); | 679 | return __hwmon_device_register(dev, name, drvdata, chip, groups); |
