Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "hwmon: (lm80) fix a missing check of bus read in lm80 probe"

This reverts commit 9aa3aa15f4c2f74f47afd6c5db4b420fadf3f315.

Because of recent interactions with developers from @umn.edu, all
commits from them have been recently re-reviewed to ensure if they were
correct or not.

Upon review, it was determined that this commit is not needed at all so
just revert it. Also, the call to lm80_init_client() was not properly
handled, so if error handling is needed in the lm80_probe() function,
then it should be done properly, not half-baked like the commit being
reverted here did.

Cc: Kangjie Lu <kjlu@umn.edu>
Fixes: 9aa3aa15f4c2 ("hwmon: (lm80) fix a missing check of bus read in lm80 probe")
Cc: stable <stable@vger.kernel.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210503115736.2104747-5-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+2 -9
+2 -9
drivers/hwmon/lm80.c
··· 596 596 struct device *dev = &client->dev; 597 597 struct device *hwmon_dev; 598 598 struct lm80_data *data; 599 - int rv; 600 599 601 600 data = devm_kzalloc(dev, sizeof(struct lm80_data), GFP_KERNEL); 602 601 if (!data) ··· 608 609 lm80_init_client(client); 609 610 610 611 /* A few vars need to be filled upon startup */ 611 - rv = lm80_read_value(client, LM80_REG_FAN_MIN(1)); 612 - if (rv < 0) 613 - return rv; 614 - data->fan[f_min][0] = rv; 615 - rv = lm80_read_value(client, LM80_REG_FAN_MIN(2)); 616 - if (rv < 0) 617 - return rv; 618 - data->fan[f_min][1] = rv; 612 + data->fan[f_min][0] = lm80_read_value(client, LM80_REG_FAN_MIN(1)); 613 + data->fan[f_min][1] = lm80_read_value(client, LM80_REG_FAN_MIN(2)); 619 614 620 615 hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name, 621 616 data, lm80_groups);