Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Uwe Kleine-König and committed by
Uwe Kleine-König
3fd269e7 5b495ac8

+34 -80
+2 -3
drivers/amba/bus.c
··· 300 300 { 301 301 struct amba_device *pcdev = to_amba_device(dev); 302 302 struct amba_driver *drv = to_amba_driver(dev->driver); 303 - int ret = 0; 304 303 305 304 pm_runtime_get_sync(dev); 306 305 if (drv->remove) 307 - ret = drv->remove(pcdev); 306 + drv->remove(pcdev); 308 307 pm_runtime_put_noidle(dev); 309 308 310 309 /* Undo the runtime PM settings in amba_probe() */ ··· 314 315 amba_put_disable_pclk(pcdev); 315 316 dev_pm_domain_detach(dev, true); 316 317 317 - return ret; 318 + return 0; 318 319 } 319 320 320 321 static void amba_shutdown(struct device *dev)
+1 -2
drivers/char/hw_random/nomadik-rng.c
··· 69 69 return ret; 70 70 } 71 71 72 - static int nmk_rng_remove(struct amba_device *dev) 72 + static void nmk_rng_remove(struct amba_device *dev) 73 73 { 74 74 amba_release_regions(dev); 75 75 clk_disable(rng_clk); 76 - return 0; 77 76 } 78 77 79 78 static const struct amba_id nmk_rng_ids[] = {
+1 -2
drivers/dma/pl330.c
··· 3195 3195 return ret; 3196 3196 } 3197 3197 3198 - static int pl330_remove(struct amba_device *adev) 3198 + static void pl330_remove(struct amba_device *adev) 3199 3199 { 3200 3200 struct pl330_dmac *pl330 = amba_get_drvdata(adev); 3201 3201 struct dma_pl330_chan *pch, *_p; ··· 3235 3235 3236 3236 if (pl330->rstc) 3237 3237 reset_control_assert(pl330->rstc); 3238 - return 0; 3239 3238 } 3240 3239 3241 3240 static const struct amba_id pl330_ids[] = {
+1 -3
drivers/gpu/drm/pl111/pl111_drv.c
··· 320 320 return ret; 321 321 } 322 322 323 - static int pl111_amba_remove(struct amba_device *amba_dev) 323 + static void pl111_amba_remove(struct amba_device *amba_dev) 324 324 { 325 325 struct device *dev = &amba_dev->dev; 326 326 struct drm_device *drm = amba_get_drvdata(amba_dev); ··· 331 331 drm_panel_bridge_remove(priv->bridge); 332 332 drm_dev_put(drm); 333 333 of_reserved_mem_device_release(dev); 334 - 335 - return 0; 336 334 } 337 335 338 336 /*
+1 -2
drivers/hwtracing/coresight/coresight-catu.c
··· 567 567 return ret; 568 568 } 569 569 570 - static int catu_remove(struct amba_device *adev) 570 + static void catu_remove(struct amba_device *adev) 571 571 { 572 572 struct catu_drvdata *drvdata = dev_get_drvdata(&adev->dev); 573 573 574 574 coresight_unregister(drvdata->csdev); 575 - return 0; 576 575 } 577 576 578 577 static struct amba_id catu_ids[] = {
+1 -3
drivers/hwtracing/coresight/coresight-cpu-debug.c
··· 627 627 return ret; 628 628 } 629 629 630 - static int debug_remove(struct amba_device *adev) 630 + static void debug_remove(struct amba_device *adev) 631 631 { 632 632 struct device *dev = &adev->dev; 633 633 struct debug_drvdata *drvdata = amba_get_drvdata(adev); ··· 642 642 643 643 if (!--debug_count) 644 644 debug_func_exit(); 645 - 646 - return 0; 647 645 } 648 646 649 647 static const struct amba_cs_uci_id uci_id_debug[] = {
+1 -3
drivers/hwtracing/coresight/coresight-cti-core.c
··· 836 836 if (drvdata->csdev_release) 837 837 drvdata->csdev_release(dev); 838 838 } 839 - static int cti_remove(struct amba_device *adev) 839 + static void cti_remove(struct amba_device *adev) 840 840 { 841 841 struct cti_drvdata *drvdata = dev_get_drvdata(&adev->dev); 842 842 ··· 845 845 mutex_unlock(&ect_mutex); 846 846 847 847 coresight_unregister(drvdata->csdev); 848 - 849 - return 0; 850 848 } 851 849 852 850 static int cti_probe(struct amba_device *adev, const struct amba_id *id)
+1 -3
drivers/hwtracing/coresight/coresight-etb10.c
··· 803 803 return ret; 804 804 } 805 805 806 - static int etb_remove(struct amba_device *adev) 806 + static void etb_remove(struct amba_device *adev) 807 807 { 808 808 struct etb_drvdata *drvdata = dev_get_drvdata(&adev->dev); 809 809 ··· 814 814 */ 815 815 misc_deregister(&drvdata->miscdev); 816 816 coresight_unregister(drvdata->csdev); 817 - 818 - return 0; 819 817 } 820 818 821 819 #ifdef CONFIG_PM
+1 -3
drivers/hwtracing/coresight/coresight-etm3x-core.c
··· 909 909 etmdrvdata[cpu] = NULL; 910 910 } 911 911 912 - static int etm_remove(struct amba_device *adev) 912 + static void etm_remove(struct amba_device *adev) 913 913 { 914 914 struct etm_drvdata *drvdata = dev_get_drvdata(&adev->dev); 915 915 ··· 932 932 cpus_read_unlock(); 933 933 934 934 coresight_unregister(drvdata->csdev); 935 - 936 - return 0; 937 935 } 938 936 939 937 #ifdef CONFIG_PM
+1 -3
drivers/hwtracing/coresight/coresight-etm4x-core.c
··· 1680 1680 etmdrvdata[cpu] = NULL; 1681 1681 } 1682 1682 1683 - static int etm4_remove(struct amba_device *adev) 1683 + static void etm4_remove(struct amba_device *adev) 1684 1684 { 1685 1685 struct etmv4_drvdata *drvdata = dev_get_drvdata(&adev->dev); 1686 1686 ··· 1703 1703 cpus_read_unlock(); 1704 1704 1705 1705 coresight_unregister(drvdata->csdev); 1706 - 1707 - return 0; 1708 1706 } 1709 1707 1710 1708 static const struct amba_id etm4_ids[] = {
+2 -2
drivers/hwtracing/coresight/coresight-funnel.c
··· 370 370 return funnel_probe(&adev->dev, &adev->res); 371 371 } 372 372 373 - static int dynamic_funnel_remove(struct amba_device *adev) 373 + static void dynamic_funnel_remove(struct amba_device *adev) 374 374 { 375 - return funnel_remove(&adev->dev); 375 + funnel_remove(&adev->dev); 376 376 } 377 377 378 378 static const struct amba_id dynamic_funnel_ids[] = {
+2 -2
drivers/hwtracing/coresight/coresight-replicator.c
··· 388 388 return replicator_probe(&adev->dev, &adev->res); 389 389 } 390 390 391 - static int dynamic_replicator_remove(struct amba_device *adev) 391 + static void dynamic_replicator_remove(struct amba_device *adev) 392 392 { 393 - return replicator_remove(&adev->dev); 393 + replicator_remove(&adev->dev); 394 394 } 395 395 396 396 static const struct amba_id dynamic_replicator_ids[] = {
+1 -3
drivers/hwtracing/coresight/coresight-stm.c
··· 951 951 return ret; 952 952 } 953 953 954 - static int stm_remove(struct amba_device *adev) 954 + static void stm_remove(struct amba_device *adev) 955 955 { 956 956 struct stm_drvdata *drvdata = dev_get_drvdata(&adev->dev); 957 957 958 958 coresight_unregister(drvdata->csdev); 959 959 960 960 stm_unregister_device(&drvdata->stm); 961 - 962 - return 0; 963 961 } 964 962 965 963 #ifdef CONFIG_PM
+1 -3
drivers/hwtracing/coresight/coresight-tmc-core.c
··· 559 559 spin_unlock_irqrestore(&drvdata->spinlock, flags); 560 560 } 561 561 562 - static int tmc_remove(struct amba_device *adev) 562 + static void tmc_remove(struct amba_device *adev) 563 563 { 564 564 struct tmc_drvdata *drvdata = dev_get_drvdata(&adev->dev); 565 565 ··· 570 570 */ 571 571 misc_deregister(&drvdata->miscdev); 572 572 coresight_unregister(drvdata->csdev); 573 - 574 - return 0; 575 573 } 576 574 577 575 static const struct amba_id tmc_ids[] = {
+1 -3
drivers/hwtracing/coresight/coresight-tpiu.c
··· 173 173 return PTR_ERR(drvdata->csdev); 174 174 } 175 175 176 - static int tpiu_remove(struct amba_device *adev) 176 + static void tpiu_remove(struct amba_device *adev) 177 177 { 178 178 struct tpiu_drvdata *drvdata = dev_get_drvdata(&adev->dev); 179 179 180 180 coresight_unregister(drvdata->csdev); 181 - 182 - return 0; 183 181 } 184 182 185 183 #ifdef CONFIG_PM
+1 -3
drivers/i2c/busses/i2c-nomadik.c
··· 1055 1055 return ret; 1056 1056 } 1057 1057 1058 - static int nmk_i2c_remove(struct amba_device *adev) 1058 + static void nmk_i2c_remove(struct amba_device *adev) 1059 1059 { 1060 1060 struct resource *res = &adev->res; 1061 1061 struct nmk_i2c_dev *dev = amba_get_drvdata(adev); ··· 1068 1068 i2c_clr_bit(dev->virtbase + I2C_CR, I2C_CR_PE); 1069 1069 clk_disable_unprepare(dev->clk); 1070 1070 release_mem_region(res->start, resource_size(res)); 1071 - 1072 - return 0; 1073 1071 } 1074 1072 1075 1073 static struct i2c_vendor_data vendor_stn8815 = {
+1 -2
drivers/input/serio/ambakmi.c
··· 159 159 return ret; 160 160 } 161 161 162 - static int amba_kmi_remove(struct amba_device *dev) 162 + static void amba_kmi_remove(struct amba_device *dev) 163 163 { 164 164 struct amba_kmi_port *kmi = amba_get_drvdata(dev); 165 165 ··· 168 168 iounmap(kmi->base); 169 169 kfree(kmi); 170 170 amba_release_regions(dev); 171 - return 0; 172 171 } 173 172 174 173 static int __maybe_unused amba_kmi_resume(struct device *dev)
+1 -3
drivers/memory/pl172.c
··· 273 273 return ret; 274 274 } 275 275 276 - static int pl172_remove(struct amba_device *adev) 276 + static void pl172_remove(struct amba_device *adev) 277 277 { 278 278 struct pl172_data *pl172 = amba_get_drvdata(adev); 279 279 280 280 clk_disable_unprepare(pl172->clk); 281 281 amba_release_regions(adev); 282 - 283 - return 0; 284 282 } 285 283 286 284 static const struct amba_id pl172_ids[] = {
+1 -3
drivers/memory/pl353-smc.c
··· 426 426 return err; 427 427 } 428 428 429 - static int pl353_smc_remove(struct amba_device *adev) 429 + static void pl353_smc_remove(struct amba_device *adev) 430 430 { 431 431 struct pl353_smc_data *pl353_smc = amba_get_drvdata(adev); 432 432 433 433 clk_disable_unprepare(pl353_smc->memclk); 434 434 clk_disable_unprepare(pl353_smc->aclk); 435 - 436 - return 0; 437 435 } 438 436 439 437 static const struct amba_id pl353_ids[] = {
+1 -3
drivers/mmc/host/mmci.c
··· 2195 2195 return ret; 2196 2196 } 2197 2197 2198 - static int mmci_remove(struct amba_device *dev) 2198 + static void mmci_remove(struct amba_device *dev) 2199 2199 { 2200 2200 struct mmc_host *mmc = amba_get_drvdata(dev); 2201 2201 ··· 2223 2223 clk_disable_unprepare(host->clk); 2224 2224 mmc_free_host(mmc); 2225 2225 } 2226 - 2227 - return 0; 2228 2226 } 2229 2227 2230 2228 #ifdef CONFIG_PM
+1 -3
drivers/rtc/rtc-pl030.c
··· 137 137 return ret; 138 138 } 139 139 140 - static int pl030_remove(struct amba_device *dev) 140 + static void pl030_remove(struct amba_device *dev) 141 141 { 142 142 struct pl030_rtc *rtc = amba_get_drvdata(dev); 143 143 ··· 146 146 free_irq(dev->irq[0], rtc); 147 147 iounmap(rtc->base); 148 148 amba_release_regions(dev); 149 - 150 - return 0; 151 149 } 152 150 153 151 static struct amba_id pl030_ids[] = {
+1 -3
drivers/rtc/rtc-pl031.c
··· 280 280 return 0; 281 281 } 282 282 283 - static int pl031_remove(struct amba_device *adev) 283 + static void pl031_remove(struct amba_device *adev) 284 284 { 285 285 struct pl031_local *ldata = dev_get_drvdata(&adev->dev); 286 286 ··· 289 289 if (adev->irq[0]) 290 290 free_irq(adev->irq[0], ldata); 291 291 amba_release_regions(adev); 292 - 293 - return 0; 294 292 } 295 293 296 294 static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
+2 -3
drivers/spi/spi-pl022.c
··· 2314 2314 return status; 2315 2315 } 2316 2316 2317 - static int 2317 + static void 2318 2318 pl022_remove(struct amba_device *adev) 2319 2319 { 2320 2320 struct pl022 *pl022 = amba_get_drvdata(adev); 2321 2321 2322 2322 if (!pl022) 2323 - return 0; 2323 + return; 2324 2324 2325 2325 /* 2326 2326 * undo pm_runtime_put() in probe. I assume that we're not ··· 2335 2335 clk_disable_unprepare(pl022->clk); 2336 2336 amba_release_regions(adev); 2337 2337 tasklet_disable(&pl022->pump_transfers); 2338 - return 0; 2339 2338 } 2340 2339 2341 2340 #ifdef CONFIG_PM_SLEEP
+1 -3
drivers/tty/serial/amba-pl010.c
··· 754 754 return ret; 755 755 } 756 756 757 - static int pl010_remove(struct amba_device *dev) 757 + static void pl010_remove(struct amba_device *dev) 758 758 { 759 759 struct uart_amba_port *uap = amba_get_drvdata(dev); 760 760 int i; ··· 770 770 771 771 if (!busy) 772 772 uart_unregister_driver(&amba_reg); 773 - 774 - return 0; 775 773 } 776 774 777 775 #ifdef CONFIG_PM_SLEEP
+1 -2
drivers/tty/serial/amba-pl011.c
··· 2679 2679 return pl011_register_port(uap); 2680 2680 } 2681 2681 2682 - static int pl011_remove(struct amba_device *dev) 2682 + static void pl011_remove(struct amba_device *dev) 2683 2683 { 2684 2684 struct uart_amba_port *uap = amba_get_drvdata(dev); 2685 2685 2686 2686 uart_remove_one_port(&amba_reg, &uap->port); 2687 2687 pl011_unregister_port(uap); 2688 - return 0; 2689 2688 } 2690 2689 2691 2690 #ifdef CONFIG_PM_SLEEP
+1 -2
drivers/vfio/platform/vfio_amba.c
··· 71 71 return ret; 72 72 } 73 73 74 - static int vfio_amba_remove(struct amba_device *adev) 74 + static void vfio_amba_remove(struct amba_device *adev) 75 75 { 76 76 struct vfio_platform_device *vdev = 77 77 vfio_platform_remove_common(&adev->dev); 78 78 79 79 kfree(vdev->name); 80 80 kfree(vdev); 81 - return 0; 82 81 } 83 82 84 83 static const struct amba_id pl330_ids[] = {
+1 -3
drivers/video/fbdev/amba-clcd.c
··· 925 925 return ret; 926 926 } 927 927 928 - static int clcdfb_remove(struct amba_device *dev) 928 + static void clcdfb_remove(struct amba_device *dev) 929 929 { 930 930 struct clcd_fb *fb = amba_get_drvdata(dev); 931 931 ··· 942 942 kfree(fb); 943 943 944 944 amba_release_regions(dev); 945 - 946 - return 0; 947 945 } 948 946 949 947 static const struct amba_id clcdfb_id_table[] = {
+1 -3
drivers/watchdog/sp805_wdt.c
··· 305 305 return ret; 306 306 } 307 307 308 - static int sp805_wdt_remove(struct amba_device *adev) 308 + static void sp805_wdt_remove(struct amba_device *adev) 309 309 { 310 310 struct sp805_wdt *wdt = amba_get_drvdata(adev); 311 311 312 312 watchdog_unregister_device(&wdt->wdd); 313 313 watchdog_set_drvdata(&wdt->wdd, NULL); 314 - 315 - return 0; 316 314 } 317 315 318 316 static int __maybe_unused sp805_wdt_suspend(struct device *dev)
+1 -1
include/linux/amba/bus.h
··· 76 76 struct amba_driver { 77 77 struct device_driver drv; 78 78 int (*probe)(struct amba_device *, const struct amba_id *); 79 - int (*remove)(struct amba_device *); 79 + void (*remove)(struct amba_device *); 80 80 void (*shutdown)(struct amba_device *); 81 81 const struct amba_id *id_table; 82 82 };
+1 -3
sound/arm/aaci.c
··· 1055 1055 return ret; 1056 1056 } 1057 1057 1058 - static int aaci_remove(struct amba_device *dev) 1058 + static void aaci_remove(struct amba_device *dev) 1059 1059 { 1060 1060 struct snd_card *card = amba_get_drvdata(dev); 1061 1061 ··· 1066 1066 snd_card_free(card); 1067 1067 amba_release_regions(dev); 1068 1068 } 1069 - 1070 - return 0; 1071 1069 } 1072 1070 1073 1071 static struct amba_id aaci_ids[] = {