power: supply: rt9471: fix using wrong ce_gpio in rt9471_probe()
PATCH v2 1/1 power: supply: rt9471: fix using wrong ce_gpio in rt9471_probe()
Pass the correct 'ce_gpio' to IS_ERR(), and remove the ce_gpio in chip data, make it all by SW control only, not to control by HW pin.
Fixes 4a1a5f6781d8 ("power: supply: rt9471: Add Richtek RT9471 charger driver")
Reviewed-by ChiYuan Huang <[email protected]>
Signed-off-by Yang Yingliang <[email protected]>
---
v1 -> v2:
Remove the ce_gpio in chip data.
--- drivers/power/supply/rt9471.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/power/supply/rt9471.c +1 -2
@@ -141,7 +141,6 @@ enum {struct rt9471_chip {struct device *dev; -struct gpio_desc *ce_gpio;struct regmap *regmap;struct regmap_field *rm_fields[F_MAX_FIELDS ];struct regmap_irq_chip_data *irq_chip_data;
@@ -851,7 +850,7 @@ static int rt9471_probe(struct i2c_client *i2c)/* Default pull charge enable gpio to make 'CHG_EN' by SW control only */ ce_gpio =devm_gpiod_get_optional (dev,"charge-enable" ,GPIOD_OUT_HIGH ); -if (IS_ERR (chip->ce_gpio)) +if (IS_ERR (ce_gpio))return dev_err_probe (dev,PTR_ERR (ce_gpio),"Failed to config charge enable gpio\n" );
Signature · 1 line
2.25.1
Hi,
Quoted 7 lines · Yang Yingliang
Pass the correct '
ce_gpio' toIS_ERR(), and remove thece_gpioin chip data, make it all by SW control only, not to control by HW pin.Fixes 4a1a5f6781d8 ("power: supply: rt9471: Add Richtek RT9471 charger driver")Reviewed-by ChiYuan Huang <[email protected]>Signed-off-by Yang Yingliang <[email protected]>---
Thanks, queued.
-- Sebastian
Quoted 30 lines
v1 -> v2:
Remove thece_gpioin chip data.--- drivers/power/supply/rt9471.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/power/supply/rt9471.c +1
-2@@ -141,7 +141,6 @@ enum {struct rt9471_chip {struct device *dev; -struct gpio_desc *ce_gpio;struct regmap *regmap;struct regmap_field *rm_fields[F_MAX_FIELDS ];struct regmap_irq_chip_data *irq_chip_data;@@ -851,7 +850,7 @@ static int rt9471_probe(struct i2c_client *i2c)/* Default pull charge enable gpio to make 'CHG_EN' by SW control only */ ce_gpio =devm_gpiod_get_optional (dev,"charge-enable" ,GPIOD_OUT_HIGH ); -if (IS_ERR (chip->ce_gpio)) +if (IS_ERR (ce_gpio))return dev_err_probe (dev,PTR_ERR (ce_gpio),"Failed to config charge enable gpio\n" );Signature · 1 line
2.25.1