Skip to content

Commit 3fd269e

Browse files
Uwe Kleine-Königukleinek
authored andcommitted
amba: Make the remove callback return void
All amba drivers return 0 in their remove callback. Together with the driver core ignoring the return value anyhow, it doesn't make sense to return a value here. Change the remove prototype to return void, which makes it explicit that returning an error value doesn't work as expected. This simplifies changing the core remove callback to return void, too. Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> # for drivers/memory Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com> # for hwtracing/coresight Acked-By: Vinod Koul <vkoul@kernel.org> # for dmaengine Acked-by: Guenter Roeck <linux@roeck-us.net> # for watchdog Acked-by: Wolfram Sang <wsa@kernel.org> # for I2C Acked-by: Takashi Iwai <tiwai@suse.de> # for sound Acked-by: Vladimir Zapolskiy <vz@mleia.com> # for memory/pl172 Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20210126165835.687514-5-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
1 parent 5b495ac commit 3fd269e

30 files changed

Lines changed: 34 additions & 80 deletions

‎drivers/amba/bus.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,10 @@ static int amba_remove(struct device *dev)
300300
{
301301
struct amba_device *pcdev = to_amba_device(dev);
302302
struct amba_driver *drv = to_amba_driver(dev->driver);
303-
int ret = 0;
304303

305304
pm_runtime_get_sync(dev);
306305
if (drv->remove)
307-
ret = drv->remove(pcdev);
306+
drv->remove(pcdev);
308307
pm_runtime_put_noidle(dev);
309308

310309
/* Undo the runtime PM settings in amba_probe() */
@@ -315,7 +314,7 @@ static int amba_remove(struct device *dev)
315314
amba_put_disable_pclk(pcdev);
316315
dev_pm_domain_detach(dev, true);
317316

318-
return ret;
317+
return 0;
319318
}
320319

321320
static void amba_shutdown(struct device *dev)

‎drivers/char/hw_random/nomadik-rng.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,10 @@ static int nmk_rng_probe(struct amba_device *dev, const struct amba_id *id)
6969
return ret;
7070
}
7171

72-
static int nmk_rng_remove(struct amba_device *dev)
72+
static void nmk_rng_remove(struct amba_device *dev)
7373
{
7474
amba_release_regions(dev);
7575
clk_disable(rng_clk);
76-
return 0;
7776
}
7877

7978
static const struct amba_id nmk_rng_ids[] = {

‎drivers/dma/pl330.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3195,7 +3195,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
31953195
return ret;
31963196
}
31973197

3198-
static int pl330_remove(struct amba_device *adev)
3198+
static void pl330_remove(struct amba_device *adev)
31993199
{
32003200
struct pl330_dmac *pl330 = amba_get_drvdata(adev);
32013201
struct dma_pl330_chan *pch, *_p;
@@ -3235,7 +3235,6 @@ static int pl330_remove(struct amba_device *adev)
32353235

32363236
if (pl330->rstc)
32373237
reset_control_assert(pl330->rstc);
3238-
return 0;
32393238
}
32403239

32413240
static const struct amba_id pl330_ids[] = {

‎drivers/gpu/drm/pl111/pl111_drv.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
320320
return ret;
321321
}
322322

323-
static int pl111_amba_remove(struct amba_device *amba_dev)
323+
static void pl111_amba_remove(struct amba_device *amba_dev)
324324
{
325325
struct device *dev = &amba_dev->dev;
326326
struct drm_device *drm = amba_get_drvdata(amba_dev);
@@ -331,8 +331,6 @@ static int pl111_amba_remove(struct amba_device *amba_dev)
331331
drm_panel_bridge_remove(priv->bridge);
332332
drm_dev_put(drm);
333333
of_reserved_mem_device_release(dev);
334-
335-
return 0;
336334
}
337335

338336
/*

‎drivers/hwtracing/coresight/coresight-catu.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,12 +567,11 @@ static int catu_probe(struct amba_device *adev, const struct amba_id *id)
567567
return ret;
568568
}
569569

570-
static int catu_remove(struct amba_device *adev)
570+
static void catu_remove(struct amba_device *adev)
571571
{
572572
struct catu_drvdata *drvdata = dev_get_drvdata(&adev->dev);
573573

574574
coresight_unregister(drvdata->csdev);
575-
return 0;
576575
}
577576

578577
static struct amba_id catu_ids[] = {

‎drivers/hwtracing/coresight/coresight-cpu-debug.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ static int debug_probe(struct amba_device *adev, const struct amba_id *id)
627627
return ret;
628628
}
629629

630-
static int debug_remove(struct amba_device *adev)
630+
static void debug_remove(struct amba_device *adev)
631631
{
632632
struct device *dev = &adev->dev;
633633
struct debug_drvdata *drvdata = amba_get_drvdata(adev);
@@ -642,8 +642,6 @@ static int debug_remove(struct amba_device *adev)
642642

643643
if (!--debug_count)
644644
debug_func_exit();
645-
646-
return 0;
647645
}
648646

649647
static const struct amba_cs_uci_id uci_id_debug[] = {

‎drivers/hwtracing/coresight/coresight-cti-core.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ static void cti_device_release(struct device *dev)
836836
if (drvdata->csdev_release)
837837
drvdata->csdev_release(dev);
838838
}
839-
static int cti_remove(struct amba_device *adev)
839+
static void cti_remove(struct amba_device *adev)
840840
{
841841
struct cti_drvdata *drvdata = dev_get_drvdata(&adev->dev);
842842

@@ -845,8 +845,6 @@ static int cti_remove(struct amba_device *adev)
845845
mutex_unlock(&ect_mutex);
846846

847847
coresight_unregister(drvdata->csdev);
848-
849-
return 0;
850848
}
851849

852850
static int cti_probe(struct amba_device *adev, const struct amba_id *id)

‎drivers/hwtracing/coresight/coresight-etb10.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ static int etb_probe(struct amba_device *adev, const struct amba_id *id)
803803
return ret;
804804
}
805805

806-
static int etb_remove(struct amba_device *adev)
806+
static void etb_remove(struct amba_device *adev)
807807
{
808808
struct etb_drvdata *drvdata = dev_get_drvdata(&adev->dev);
809809

@@ -814,8 +814,6 @@ static int etb_remove(struct amba_device *adev)
814814
*/
815815
misc_deregister(&drvdata->miscdev);
816816
coresight_unregister(drvdata->csdev);
817-
818-
return 0;
819817
}
820818

821819
#ifdef CONFIG_PM

‎drivers/hwtracing/coresight/coresight-etm3x-core.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ static void clear_etmdrvdata(void *info)
909909
etmdrvdata[cpu] = NULL;
910910
}
911911

912-
static int etm_remove(struct amba_device *adev)
912+
static void etm_remove(struct amba_device *adev)
913913
{
914914
struct etm_drvdata *drvdata = dev_get_drvdata(&adev->dev);
915915

@@ -932,8 +932,6 @@ static int etm_remove(struct amba_device *adev)
932932
cpus_read_unlock();
933933

934934
coresight_unregister(drvdata->csdev);
935-
936-
return 0;
937935
}
938936

939937
#ifdef CONFIG_PM

‎drivers/hwtracing/coresight/coresight-etm4x-core.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ static void clear_etmdrvdata(void *info)
16801680
etmdrvdata[cpu] = NULL;
16811681
}
16821682

1683-
static int etm4_remove(struct amba_device *adev)
1683+
static void etm4_remove(struct amba_device *adev)
16841684
{
16851685
struct etmv4_drvdata *drvdata = dev_get_drvdata(&adev->dev);
16861686

@@ -1703,8 +1703,6 @@ static int etm4_remove(struct amba_device *adev)
17031703
cpus_read_unlock();
17041704

17051705
coresight_unregister(drvdata->csdev);
1706-
1707-
return 0;
17081706
}
17091707

17101708
static const struct amba_id etm4_ids[] = {

0 commit comments

Comments
 (0)