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

hwmon: (asus-ec-sensors) do not print from .probe()

Remove the call to dev_info() from the board detection function, which
is called from probe(), not only to be in line with hwmon driver rules, but
also because the message duplicates the error code returned from probe()
for that case (ENODEV).

Changes in:
- v2: add missing newline (style).

Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20220217194318.2960472-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Eugene Shalygin and committed by
Guenter Roeck
567e77a2 da78ad2b

+5 -11
+5 -11
drivers/hwmon/asus-ec-sensors.c
··· 597 597 .ops = &asus_ec_hwmon_ops, 598 598 }; 599 599 600 - static unsigned long __init 601 - get_board_sensors(const struct device *dev) 600 + static unsigned long __init get_board_sensors(void) 602 601 { 603 - const struct dmi_system_id *dmi_entry; 602 + const struct dmi_system_id *dmi_entry = 603 + dmi_first_match(asus_ec_dmi_table); 604 604 605 - dmi_entry = dmi_first_match(asus_ec_dmi_table); 606 - if (!dmi_entry) { 607 - dev_info(dev, "Unsupported board"); 608 - return 0; 609 - } 610 - 611 - return (unsigned long)dmi_entry->driver_data; 605 + return dmi_entry ? (unsigned long)dmi_entry->driver_data : 0; 612 606 } 613 607 614 608 static int __init asus_ec_probe(struct platform_device *pdev) ··· 619 625 struct device *hwdev; 620 626 unsigned int i; 621 627 622 - board_sensors = get_board_sensors(dev); 628 + board_sensors = get_board_sensors(); 623 629 if (!board_sensors) 624 630 return -ENODEV; 625 631