lkml.org 
[lkml]   [2021]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 08/13] power: supply: bq25890: Drop dev->platform_data == NULL check
Date
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 "ti,skip-init" property the driver can actually supports
devices without devicetree and this check no longer makes sense.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/power/supply/bq25890_charger.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
index aa4d04d20cdc..163ca5d761aa 100644
--- a/drivers/power/supply/bq25890_charger.c
+++ b/drivers/power/supply/bq25890_charger.c
@@ -990,14 +990,10 @@ static int bq25890_probe(struct i2c_client *client,
return ret;
}

- if (!dev->platform_data) {
- ret = bq25890_fw_probe(bq);
- if (ret < 0) {
- dev_err(dev, "Cannot read device properties.\n");
- return ret;
- }
- } else {
- return -ENODEV;
+ ret = bq25890_fw_probe(bq);
+ if (ret < 0) {
+ dev_err(dev, "Cannot read device properties.\n");
+ return ret;
}

ret = bq25890_hw_init(bq);
--
2.31.1
\
 
 \ /
  Last update: 2021-10-30 20:30    [W:0.249 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site