Skip to content

Commit 1d6cdc4

Browse files
Yang Yingliangsre
authored andcommitted
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: 4a1a5f6 ("power: supply: rt9471: Add Richtek RT9471 charger driver") Reviewed-by: ChiYuan Huang <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent a915dfd commit 1d6cdc4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/power/supply/rt9471.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ enum {
141141

142142
struct rt9471_chip {
143143
struct device *dev;
144-
struct gpio_desc *ce_gpio;
145144
struct regmap *regmap;
146145
struct regmap_field *rm_fields[F_MAX_FIELDS];
147146
struct regmap_irq_chip_data *irq_chip_data;
@@ -851,7 +850,7 @@ static int rt9471_probe(struct i2c_client *i2c)
851850

852851
/* Default pull charge enable gpio to make 'CHG_EN' by SW control only */
853852
ce_gpio = devm_gpiod_get_optional(dev, "charge-enable", GPIOD_OUT_HIGH);
854-
if (IS_ERR(chip->ce_gpio))
853+
if (IS_ERR(ce_gpio))
855854
return dev_err_probe(dev, PTR_ERR(ce_gpio),
856855
"Failed to config charge enable gpio\n");
857856

0 commit comments

Comments
 (0)