hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/regulator/tps65132-regulator.c
....@@ -136,10 +136,10 @@
136136 struct tps65132_reg_pdata *rpdata = &tps->reg_pdata[desc->id];
137137 int ret;
138138
139
- rpdata->en_gpiod = devm_fwnode_get_index_gpiod_from_child(tps->dev,
140
- "enable", 0, &np->fwnode,
141
- GPIOD_OUT_HIGH, "enable");
142
- if (IS_ERR_OR_NULL(rpdata->en_gpiod)) {
139
+ rpdata->en_gpiod = devm_fwnode_gpiod_get(tps->dev, of_fwnode_handle(np),
140
+ "enable", GPIOD_ASIS,
141
+ "enable");
142
+ if (IS_ERR(rpdata->en_gpiod)) {
143143 ret = PTR_ERR(rpdata->en_gpiod);
144144
145145 /* Ignore the error other than probe defer */
....@@ -148,10 +148,12 @@
148148 return 0;
149149 }
150150
151
- rpdata->act_dis_gpiod = devm_fwnode_get_index_gpiod_from_child(
152
- tps->dev, "active-discharge", 0,
153
- &np->fwnode, 0, "active-discharge");
154
- if (IS_ERR_OR_NULL(rpdata->act_dis_gpiod)) {
151
+ rpdata->act_dis_gpiod = devm_fwnode_gpiod_get(tps->dev,
152
+ of_fwnode_handle(np),
153
+ "active-discharge",
154
+ GPIOD_ASIS,
155
+ "active-discharge");
156
+ if (IS_ERR(rpdata->act_dis_gpiod)) {
155157 ret = PTR_ERR(rpdata->act_dis_gpiod);
156158
157159 /* Ignore the error other than probe defer */
....@@ -218,8 +220,7 @@
218220 .wr_table = &tps65132_no_reg_table,
219221 };
220222
221
-static int tps65132_probe(struct i2c_client *client,
222
- const struct i2c_device_id *client_id)
223
+static int tps65132_probe(struct i2c_client *client)
223224 {
224225 struct device *dev = &client->dev;
225226 struct tps65132_regulator *tps;
....@@ -270,7 +271,7 @@
270271 .driver = {
271272 .name = "tps65132",
272273 },
273
- .probe = tps65132_probe,
274
+ .probe_new = tps65132_probe,
274275 .id_table = tps65132_id,
275276 };
276277