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

Configure Feed

Select the types of activity you want to include in your feed.

power: supply: bq25890: Drop dev->platform_data == NULL check

Drop the "if (!dev->platform_data)" check, this seems to be an attempt
for allowing loading the driver on devices without devicetree stemming
from the initial commit of the driver (with the presumed intention being
the "return -ENODEV" else branch getting replaced with something else).

With the new "linux,skip-init" and "linux,read-back-settings" properties
the driver can actually supports devices without devicetree and this
check no longer makes sense.

While at it, also switch to dev_err_probe(), which is already used in
various other places in the driver.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Hans de Goede and committed by
Sebastian Reichel
f481d5b8 06c75095

+3 -10
+3 -10
drivers/power/supply/bq25890_charger.c
··· 1048 1048 return ret; 1049 1049 } 1050 1050 1051 - if (!dev->platform_data) { 1052 - ret = bq25890_fw_probe(bq); 1053 - if (ret < 0) { 1054 - dev_err(dev, "Cannot read device properties: %d\n", 1055 - ret); 1056 - return ret; 1057 - } 1058 - } else { 1059 - return -ENODEV; 1060 - } 1051 + ret = bq25890_fw_probe(bq); 1052 + if (ret < 0) 1053 + return dev_err_probe(dev, ret, "reading device properties\n"); 1061 1054 1062 1055 ret = bq25890_hw_init(bq); 1063 1056 if (ret < 0) {