Skip to content

Commit 6fe341a

Browse files
committed
Merge tag 'memory-controller-drv-6.8-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers
Memory controller drivers for v6.8, part two Convert all drivers platform remove callback to the "remove_new" which returns void. Usual rationale from Uwe: The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. * tag 'memory-controller-drv-6.8-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: ti-emif-pm: Convert to platform remove callback returning void memory: ti-aemif: Convert to platform remove callback returning void memory: tegra210-emc: Convert to platform remove callback returning void memory: tegra186-emc: Convert to platform remove callback returning void memory: stm32-fmc2-ebi: Convert to platform remove callback returning void memory: exynos5422-dmc: Convert to platform remove callback returning void memory: renesas-rpc-if: Convert to platform remove callback returning void memory: omap-gpmc: Convert to platform remove callback returning void memory: mtk-smi: Convert to platform remove callback returning void memory: jz4780-nemc: Convert to platform remove callback returning void memory: fsl_ifc: Convert to platform remove callback returning void memory: fsl-corenet-cf: Convert to platform remove callback returning void memory: emif: Convert to platform remove callback returning void memory: brcmstb_memc: Convert to platform remove callback returning void memory: brcmstb_dpfe: Convert to platform remove callback returning void Link: https://lore.kernel.org/r/20231221101956.16351-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents 8d446ff + 365fcc0 commit 6fe341a

15 files changed

Lines changed: 32 additions & 60 deletions

drivers/memory/brcmstb_dpfe.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -909,13 +909,11 @@ static int brcmstb_dpfe_probe(struct platform_device *pdev)
909909
return ret;
910910
}
911911

912-
static int brcmstb_dpfe_remove(struct platform_device *pdev)
912+
static void brcmstb_dpfe_remove(struct platform_device *pdev)
913913
{
914914
struct brcmstb_dpfe_priv *priv = dev_get_drvdata(&pdev->dev);
915915

916916
sysfs_remove_groups(&pdev->dev.kobj, priv->dpfe_api->sysfs_attrs);
917-
918-
return 0;
919917
}
920918

921919
static const struct of_device_id brcmstb_dpfe_of_match[] = {
@@ -936,7 +934,7 @@ static struct platform_driver brcmstb_dpfe_driver = {
936934
.of_match_table = brcmstb_dpfe_of_match,
937935
},
938936
.probe = brcmstb_dpfe_probe,
939-
.remove = brcmstb_dpfe_remove,
937+
.remove_new = brcmstb_dpfe_remove,
940938
.resume = brcmstb_dpfe_resume,
941939
};
942940

drivers/memory/brcmstb_memc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,11 @@ static int brcmstb_memc_probe(struct platform_device *pdev)
152152
return 0;
153153
}
154154

155-
static int brcmstb_memc_remove(struct platform_device *pdev)
155+
static void brcmstb_memc_remove(struct platform_device *pdev)
156156
{
157157
struct device *dev = &pdev->dev;
158158

159159
sysfs_remove_group(&dev->kobj, &dev_attr_group);
160-
161-
return 0;
162160
}
163161

164162
enum brcmstb_memc_hwtype {
@@ -284,7 +282,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(brcmstb_memc_pm_ops, brcmstb_memc_suspend,
284282

285283
static struct platform_driver brcmstb_memc_driver = {
286284
.probe = brcmstb_memc_probe,
287-
.remove = brcmstb_memc_remove,
285+
.remove_new = brcmstb_memc_remove,
288286
.driver = {
289287
.name = "brcmstb_memc",
290288
.of_match_table = brcmstb_memc_of_match,

drivers/memory/emif.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,13 +1159,11 @@ static int __init_or_module emif_probe(struct platform_device *pdev)
11591159
return -ENODEV;
11601160
}
11611161

1162-
static int __exit emif_remove(struct platform_device *pdev)
1162+
static void __exit emif_remove(struct platform_device *pdev)
11631163
{
11641164
struct emif_data *emif = platform_get_drvdata(pdev);
11651165

11661166
emif_debugfs_exit(emif);
1167-
1168-
return 0;
11691167
}
11701168

11711169
static void emif_shutdown(struct platform_device *pdev)
@@ -1185,7 +1183,7 @@ MODULE_DEVICE_TABLE(of, emif_of_match);
11851183
#endif
11861184

11871185
static struct platform_driver emif_driver = {
1188-
.remove = __exit_p(emif_remove),
1186+
.remove_new = __exit_p(emif_remove),
11891187
.shutdown = emif_shutdown,
11901188
.driver = {
11911189
.name = "emif",

drivers/memory/fsl-corenet-cf.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ static int ccf_probe(struct platform_device *pdev)
223223
return 0;
224224
}
225225

226-
static int ccf_remove(struct platform_device *pdev)
226+
static void ccf_remove(struct platform_device *pdev)
227227
{
228228
struct ccf_private *ccf = dev_get_drvdata(&pdev->dev);
229229

@@ -241,8 +241,6 @@ static int ccf_remove(struct platform_device *pdev)
241241
iowrite32be(0, &ccf->err_regs->errinten);
242242
break;
243243
}
244-
245-
return 0;
246244
}
247245

248246
static struct platform_driver ccf_driver = {
@@ -251,7 +249,7 @@ static struct platform_driver ccf_driver = {
251249
.of_match_table = ccf_matches,
252250
},
253251
.probe = ccf_probe,
254-
.remove = ccf_remove,
252+
.remove_new = ccf_remove,
255253
};
256254

257255
module_platform_driver(ccf_driver);

drivers/memory/fsl_ifc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static int fsl_ifc_ctrl_init(struct fsl_ifc_ctrl *ctrl)
8484
return 0;
8585
}
8686

87-
static int fsl_ifc_ctrl_remove(struct platform_device *dev)
87+
static void fsl_ifc_ctrl_remove(struct platform_device *dev)
8888
{
8989
struct fsl_ifc_ctrl *ctrl = dev_get_drvdata(&dev->dev);
9090

@@ -98,8 +98,6 @@ static int fsl_ifc_ctrl_remove(struct platform_device *dev)
9898
iounmap(ctrl->gregs);
9999

100100
dev_set_drvdata(&dev->dev, NULL);
101-
102-
return 0;
103101
}
104102

105103
/*
@@ -318,7 +316,7 @@ static struct platform_driver fsl_ifc_ctrl_driver = {
318316
.of_match_table = fsl_ifc_match,
319317
},
320318
.probe = fsl_ifc_ctrl_probe,
321-
.remove = fsl_ifc_ctrl_remove,
319+
.remove_new = fsl_ifc_ctrl_remove,
322320
};
323321

324322
static int __init fsl_ifc_init(void)

drivers/memory/jz4780-nemc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,11 @@ static int jz4780_nemc_probe(struct platform_device *pdev)
384384
return 0;
385385
}
386386

387-
static int jz4780_nemc_remove(struct platform_device *pdev)
387+
static void jz4780_nemc_remove(struct platform_device *pdev)
388388
{
389389
struct jz4780_nemc *nemc = platform_get_drvdata(pdev);
390390

391391
clk_disable_unprepare(nemc->clk);
392-
return 0;
393392
}
394393

395394
static const struct jz_soc_info jz4740_soc_info = {
@@ -408,7 +407,7 @@ static const struct of_device_id jz4780_nemc_dt_match[] = {
408407

409408
static struct platform_driver jz4780_nemc_driver = {
410409
.probe = jz4780_nemc_probe,
411-
.remove = jz4780_nemc_remove,
410+
.remove_new = jz4780_nemc_remove,
412411
.driver = {
413412
.name = "jz4780-nemc",
414413
.of_match_table = of_match_ptr(jz4780_nemc_dt_match),

drivers/memory/mtk-smi.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -566,14 +566,13 @@ static int mtk_smi_larb_probe(struct platform_device *pdev)
566566
return ret;
567567
}
568568

569-
static int mtk_smi_larb_remove(struct platform_device *pdev)
569+
static void mtk_smi_larb_remove(struct platform_device *pdev)
570570
{
571571
struct mtk_smi_larb *larb = platform_get_drvdata(pdev);
572572

573573
device_link_remove(&pdev->dev, larb->smi_common_dev);
574574
pm_runtime_disable(&pdev->dev);
575575
component_del(&pdev->dev, &mtk_smi_larb_component_ops);
576-
return 0;
577576
}
578577

579578
static int __maybe_unused mtk_smi_larb_resume(struct device *dev)
@@ -616,7 +615,7 @@ static const struct dev_pm_ops smi_larb_pm_ops = {
616615

617616
static struct platform_driver mtk_smi_larb_driver = {
618617
.probe = mtk_smi_larb_probe,
619-
.remove = mtk_smi_larb_remove,
618+
.remove_new = mtk_smi_larb_remove,
620619
.driver = {
621620
.name = "mtk-smi-larb",
622621
.of_match_table = mtk_smi_larb_of_ids,
@@ -795,14 +794,13 @@ static int mtk_smi_common_probe(struct platform_device *pdev)
795794
return 0;
796795
}
797796

798-
static int mtk_smi_common_remove(struct platform_device *pdev)
797+
static void mtk_smi_common_remove(struct platform_device *pdev)
799798
{
800799
struct mtk_smi *common = dev_get_drvdata(&pdev->dev);
801800

802801
if (common->plat->type == MTK_SMI_GEN2_SUB_COMM)
803802
device_link_remove(&pdev->dev, common->smi_common_dev);
804803
pm_runtime_disable(&pdev->dev);
805-
return 0;
806804
}
807805

808806
static int __maybe_unused mtk_smi_common_resume(struct device *dev)
@@ -842,7 +840,7 @@ static const struct dev_pm_ops smi_common_pm_ops = {
842840

843841
static struct platform_driver mtk_smi_common_driver = {
844842
.probe = mtk_smi_common_probe,
845-
.remove = mtk_smi_common_remove,
843+
.remove_new = mtk_smi_common_remove,
846844
.driver = {
847845
.name = "mtk-smi-common",
848846
.of_match_table = mtk_smi_common_of_ids,

drivers/memory/omap-gpmc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2690,7 +2690,7 @@ static int gpmc_probe(struct platform_device *pdev)
26902690
return rc;
26912691
}
26922692

2693-
static int gpmc_remove(struct platform_device *pdev)
2693+
static void gpmc_remove(struct platform_device *pdev)
26942694
{
26952695
int i;
26962696
struct gpmc_device *gpmc = platform_get_drvdata(pdev);
@@ -2702,8 +2702,6 @@ static int gpmc_remove(struct platform_device *pdev)
27022702
gpmc_mem_exit();
27032703
pm_runtime_put_sync(&pdev->dev);
27042704
pm_runtime_disable(&pdev->dev);
2705-
2706-
return 0;
27072705
}
27082706

27092707
#ifdef CONFIG_PM_SLEEP
@@ -2747,7 +2745,7 @@ MODULE_DEVICE_TABLE(of, gpmc_dt_ids);
27472745

27482746
static struct platform_driver gpmc_driver = {
27492747
.probe = gpmc_probe,
2750-
.remove = gpmc_remove,
2748+
.remove_new = gpmc_remove,
27512749
.driver = {
27522750
.name = DEVICE_NAME,
27532751
.of_match_table = of_match_ptr(gpmc_dt_ids),

drivers/memory/renesas-rpc-if.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -777,13 +777,11 @@ static int rpcif_probe(struct platform_device *pdev)
777777
return 0;
778778
}
779779

780-
static int rpcif_remove(struct platform_device *pdev)
780+
static void rpcif_remove(struct platform_device *pdev)
781781
{
782782
struct rpcif_priv *rpc = platform_get_drvdata(pdev);
783783

784784
platform_device_unregister(rpc->vdev);
785-
786-
return 0;
787785
}
788786

789787
static const struct of_device_id rpcif_of_match[] = {
@@ -797,7 +795,7 @@ MODULE_DEVICE_TABLE(of, rpcif_of_match);
797795

798796
static struct platform_driver rpcif_driver = {
799797
.probe = rpcif_probe,
800-
.remove = rpcif_remove,
798+
.remove_new = rpcif_remove,
801799
.driver = {
802800
.name = "rpc-if",
803801
.of_match_table = rpcif_of_match,

drivers/memory/samsung/exynos5422-dmc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,7 @@ static int exynos5_dmc_probe(struct platform_device *pdev)
15581558
* clean the device's resources. It just calls explicitly disable function for
15591559
* the performance counters.
15601560
*/
1561-
static int exynos5_dmc_remove(struct platform_device *pdev)
1561+
static void exynos5_dmc_remove(struct platform_device *pdev)
15621562
{
15631563
struct exynos5_dmc *dmc = dev_get_drvdata(&pdev->dev);
15641564

@@ -1569,8 +1569,6 @@ static int exynos5_dmc_remove(struct platform_device *pdev)
15691569

15701570
clk_disable_unprepare(dmc->mout_bpll);
15711571
clk_disable_unprepare(dmc->fout_bpll);
1572-
1573-
return 0;
15741572
}
15751573

15761574
static const struct of_device_id exynos5_dmc_of_match[] = {
@@ -1581,7 +1579,7 @@ MODULE_DEVICE_TABLE(of, exynos5_dmc_of_match);
15811579

15821580
static struct platform_driver exynos5_dmc_platdrv = {
15831581
.probe = exynos5_dmc_probe,
1584-
.remove = exynos5_dmc_remove,
1582+
.remove_new = exynos5_dmc_remove,
15851583
.driver = {
15861584
.name = "exynos5-dmc",
15871585
.of_match_table = exynos5_dmc_of_match,

0 commit comments

Comments
 (0)