Skip to content

Commit a142ae7

Browse files
committed
regulator: Convert to platform remove callback
Merge series from Uwe Kleine-König <u.kleine-koenig@pengutronix.de>: Hello, this series converts all drivers below drivers/regulator to struct platform_driver::remove_new(). See commit 5c5a768 ("platform: Provide a remove callback that returns no value") for an extended explanation and the eventual goal. All conversations are trivial, because all .remove() callbacks returned zero unconditionally. There are no interdependencies between these patches, so they could be picked up individually. However I'd expect them to go in all together via Mark's regulator tree. Best regards Uwe Uwe Kleine-König (8): regulator: arizona-ldo1: Convert to platform remove callback returning void regulator: bd9571mwv: Convert to platform remove callback returning void regulator: db8500-prcmu: Convert to platform remove callback returning void regulator: stm32-vrefbuf: Convert to platform remove callback returning void regulator: uniphier: Convert to platform remove callback returning void regulator: userspace-consumer: Convert to platform remove callback returning void regulator: virtual: Convert to platform remove callback returning void regulator: wm8350: Convert to platform remove callback returning void drivers/regulator/arizona-ldo1.c | 8 +++----- drivers/regulator/bd9571mwv-regulator.c | 5 ++--- drivers/regulator/db8500-prcmu.c | 6 ++---- drivers/regulator/stm32-vrefbuf.c | 6 ++---- drivers/regulator/uniphier-regulator.c | 6 ++---- drivers/regulator/userspace-consumer.c | 6 ++---- drivers/regulator/virtual.c | 6 ++---- drivers/regulator/wm8350-regulator.c | 6 ++---- 8 files changed, 17 insertions(+), 32 deletions(-) base-commit: 0f5f12a -- 2.42.0
2 parents 16e5ac1 + 8d6fab5 commit a142ae7

File tree

8 files changed

+17
-32
lines changed

8 files changed

+17
-32
lines changed

drivers/regulator/arizona-ldo1.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,12 @@ static int arizona_ldo1_probe(struct platform_device *pdev)
339339
return ret;
340340
}
341341

342-
static int arizona_ldo1_remove(struct platform_device *pdev)
342+
static void arizona_ldo1_remove(struct platform_device *pdev)
343343
{
344344
struct arizona_ldo1 *ldo1 = platform_get_drvdata(pdev);
345345

346346
if (ldo1->ena_gpiod)
347347
gpiod_put(ldo1->ena_gpiod);
348-
349-
return 0;
350348
}
351349

352350
static int madera_ldo1_probe(struct platform_device *pdev)
@@ -377,7 +375,7 @@ static int madera_ldo1_probe(struct platform_device *pdev)
377375

378376
static struct platform_driver arizona_ldo1_driver = {
379377
.probe = arizona_ldo1_probe,
380-
.remove = arizona_ldo1_remove,
378+
.remove_new = arizona_ldo1_remove,
381379
.driver = {
382380
.name = "arizona-ldo1",
383381
.probe_type = PROBE_FORCE_SYNCHRONOUS,
@@ -386,7 +384,7 @@ static struct platform_driver arizona_ldo1_driver = {
386384

387385
static struct platform_driver madera_ldo1_driver = {
388386
.probe = madera_ldo1_probe,
389-
.remove = arizona_ldo1_remove,
387+
.remove_new = arizona_ldo1_remove,
390388
.driver = {
391389
.name = "madera-ldo1",
392390
.probe_type = PROBE_FORCE_SYNCHRONOUS,

drivers/regulator/bd9571mwv-regulator.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,9 @@ static const struct dev_pm_ops bd9571mwv_pm = {
260260
SET_SYSTEM_SLEEP_PM_OPS(bd9571mwv_suspend, bd9571mwv_resume)
261261
};
262262

263-
static int bd9571mwv_regulator_remove(struct platform_device *pdev)
263+
static void bd9571mwv_regulator_remove(struct platform_device *pdev)
264264
{
265265
device_remove_file(&pdev->dev, &dev_attr_backup_mode);
266-
return 0;
267266
}
268267
#define DEV_PM_OPS &bd9571mwv_pm
269268
#else
@@ -357,7 +356,7 @@ static struct platform_driver bd9571mwv_regulator_driver = {
357356
.pm = DEV_PM_OPS,
358357
},
359358
.probe = bd9571mwv_regulator_probe,
360-
.remove = bd9571mwv_regulator_remove,
359+
.remove_new = bd9571mwv_regulator_remove,
361360
.id_table = bd9571mwv_regulator_id_table,
362361
};
363362
module_platform_driver(bd9571mwv_regulator_driver);

drivers/regulator/db8500-prcmu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,11 +469,9 @@ static int db8500_regulator_probe(struct platform_device *pdev)
469469
return 0;
470470
}
471471

472-
static int db8500_regulator_remove(struct platform_device *pdev)
472+
static void db8500_regulator_remove(struct platform_device *pdev)
473473
{
474474
ux500_regulator_debug_exit();
475-
476-
return 0;
477475
}
478476

479477
static struct platform_driver db8500_regulator_driver = {
@@ -482,7 +480,7 @@ static struct platform_driver db8500_regulator_driver = {
482480
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
483481
},
484482
.probe = db8500_regulator_probe,
485-
.remove = db8500_regulator_remove,
483+
.remove_new = db8500_regulator_remove,
486484
};
487485

488486
static int __init db8500_regulator_init(void)

drivers/regulator/stm32-vrefbuf.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ static int stm32_vrefbuf_probe(struct platform_device *pdev)
233233
return ret;
234234
}
235235

236-
static int stm32_vrefbuf_remove(struct platform_device *pdev)
236+
static void stm32_vrefbuf_remove(struct platform_device *pdev)
237237
{
238238
struct regulator_dev *rdev = platform_get_drvdata(pdev);
239239
struct stm32_vrefbuf *priv = rdev_get_drvdata(rdev);
@@ -244,8 +244,6 @@ static int stm32_vrefbuf_remove(struct platform_device *pdev)
244244
pm_runtime_disable(&pdev->dev);
245245
pm_runtime_set_suspended(&pdev->dev);
246246
pm_runtime_put_noidle(&pdev->dev);
247-
248-
return 0;
249247
};
250248

251249
static int __maybe_unused stm32_vrefbuf_runtime_suspend(struct device *dev)
@@ -282,7 +280,7 @@ MODULE_DEVICE_TABLE(of, stm32_vrefbuf_of_match);
282280

283281
static struct platform_driver stm32_vrefbuf_driver = {
284282
.probe = stm32_vrefbuf_probe,
285-
.remove = stm32_vrefbuf_remove,
283+
.remove_new = stm32_vrefbuf_remove,
286284
.driver = {
287285
.name = "stm32-vrefbuf",
288286
.probe_type = PROBE_PREFER_ASYNCHRONOUS,

drivers/regulator/uniphier-regulator.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static int uniphier_regulator_probe(struct platform_device *pdev)
115115
return ret;
116116
}
117117

118-
static int uniphier_regulator_remove(struct platform_device *pdev)
118+
static void uniphier_regulator_remove(struct platform_device *pdev)
119119
{
120120
struct uniphier_regulator_priv *priv = platform_get_drvdata(pdev);
121121
int i;
@@ -124,8 +124,6 @@ static int uniphier_regulator_remove(struct platform_device *pdev)
124124
reset_control_assert(priv->rst[i]);
125125

126126
clk_bulk_disable_unprepare(priv->data->nclks, priv->clk);
127-
128-
return 0;
129127
}
130128

131129
/* USB3 controller data */
@@ -209,7 +207,7 @@ MODULE_DEVICE_TABLE(of, uniphier_regulator_match);
209207

210208
static struct platform_driver uniphier_regulator_driver = {
211209
.probe = uniphier_regulator_probe,
212-
.remove = uniphier_regulator_remove,
210+
.remove_new = uniphier_regulator_remove,
213211
.driver = {
214212
.name = "uniphier-regulator",
215213
.probe_type = PROBE_PREFER_ASYNCHRONOUS,

drivers/regulator/userspace-consumer.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,14 @@ static int regulator_userspace_consumer_probe(struct platform_device *pdev)
194194
return ret;
195195
}
196196

197-
static int regulator_userspace_consumer_remove(struct platform_device *pdev)
197+
static void regulator_userspace_consumer_remove(struct platform_device *pdev)
198198
{
199199
struct userspace_consumer_data *data = platform_get_drvdata(pdev);
200200

201201
sysfs_remove_group(&pdev->dev.kobj, &attr_group);
202202

203203
if (data->enabled && !data->no_autoswitch)
204204
regulator_bulk_disable(data->num_supplies, data->supplies);
205-
206-
return 0;
207205
}
208206

209207
static const struct of_device_id regulator_userspace_consumer_of_match[] = {
@@ -213,7 +211,7 @@ static const struct of_device_id regulator_userspace_consumer_of_match[] = {
213211

214212
static struct platform_driver regulator_userspace_consumer_driver = {
215213
.probe = regulator_userspace_consumer_probe,
216-
.remove = regulator_userspace_consumer_remove,
214+
.remove_new = regulator_userspace_consumer_remove,
217215
.driver = {
218216
.name = "reg-userspace-consumer",
219217
.probe_type = PROBE_PREFER_ASYNCHRONOUS,

drivers/regulator/virtual.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,21 +345,19 @@ static int regulator_virtual_probe(struct platform_device *pdev)
345345
return 0;
346346
}
347347

348-
static int regulator_virtual_remove(struct platform_device *pdev)
348+
static void regulator_virtual_remove(struct platform_device *pdev)
349349
{
350350
struct virtual_consumer_data *drvdata = platform_get_drvdata(pdev);
351351

352352
sysfs_remove_group(&pdev->dev.kobj, &regulator_virtual_attr_group);
353353

354354
if (drvdata->enabled)
355355
regulator_disable(drvdata->regulator);
356-
357-
return 0;
358356
}
359357

360358
static struct platform_driver regulator_virtual_consumer_driver = {
361359
.probe = regulator_virtual_probe,
362-
.remove = regulator_virtual_remove,
360+
.remove_new = regulator_virtual_remove,
363361
.driver = {
364362
.name = "reg-virt-consumer",
365363
.probe_type = PROBE_PREFER_ASYNCHRONOUS,

drivers/regulator/wm8350-regulator.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,14 +1158,12 @@ static int wm8350_regulator_probe(struct platform_device *pdev)
11581158
return 0;
11591159
}
11601160

1161-
static int wm8350_regulator_remove(struct platform_device *pdev)
1161+
static void wm8350_regulator_remove(struct platform_device *pdev)
11621162
{
11631163
struct regulator_dev *rdev = platform_get_drvdata(pdev);
11641164
struct wm8350 *wm8350 = rdev_get_drvdata(rdev);
11651165

11661166
wm8350_free_irq(wm8350, wm8350_reg[pdev->id].irq, rdev);
1167-
1168-
return 0;
11691167
}
11701168

11711169
int wm8350_register_regulator(struct wm8350 *wm8350, int reg,
@@ -1306,7 +1304,7 @@ EXPORT_SYMBOL_GPL(wm8350_register_led);
13061304

13071305
static struct platform_driver wm8350_regulator_driver = {
13081306
.probe = wm8350_regulator_probe,
1309-
.remove = wm8350_regulator_remove,
1307+
.remove_new = wm8350_regulator_remove,
13101308
.driver = {
13111309
.name = "wm8350-regulator",
13121310
.probe_type = PROBE_PREFER_ASYNCHRONOUS,

0 commit comments

Comments
 (0)