From f34b902c5ba67841902cd7f0e24e64bb82f69cb4 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Mon, 25 Sep 2023 11:55:24 +0200 Subject: soc/ti: k3-ringacc: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-34-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon --- drivers/soc/ti/k3-ringacc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/soc/ti') diff --git a/drivers/soc/ti/k3-ringacc.c b/drivers/soc/ti/k3-ringacc.c index 148f54d9691d..fd4251d75935 100644 --- a/drivers/soc/ti/k3-ringacc.c +++ b/drivers/soc/ti/k3-ringacc.c @@ -1551,19 +1551,18 @@ static int k3_ringacc_probe(struct platform_device *pdev) return 0; } -static int k3_ringacc_remove(struct platform_device *pdev) +static void k3_ringacc_remove(struct platform_device *pdev) { struct k3_ringacc *ringacc = dev_get_drvdata(&pdev->dev); mutex_lock(&k3_ringacc_list_lock); list_del(&ringacc->list); mutex_unlock(&k3_ringacc_list_lock); - return 0; } static struct platform_driver k3_ringacc_driver = { .probe = k3_ringacc_probe, - .remove = k3_ringacc_remove, + .remove_new = k3_ringacc_remove, .driver = { .name = "k3-ringacc", .of_match_table = k3_ringacc_of_match, -- cgit v1.2.3 From 3af4ec7c7dd39a2c4618f6536b2e7b73a19be169 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Mon, 25 Sep 2023 11:55:25 +0200 Subject: soc/ti: knav_dma: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-35-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon --- drivers/soc/ti/knav_dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/soc/ti') diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c index 0fbc37cd5123..6023006685fc 100644 --- a/drivers/soc/ti/knav_dma.c +++ b/drivers/soc/ti/knav_dma.c @@ -773,7 +773,7 @@ err_pm_disable: return ret; } -static int knav_dma_remove(struct platform_device *pdev) +static void knav_dma_remove(struct platform_device *pdev) { struct knav_dma_device *dma; @@ -784,8 +784,6 @@ static int knav_dma_remove(struct platform_device *pdev) pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } static struct of_device_id of_match[] = { @@ -797,7 +795,7 @@ MODULE_DEVICE_TABLE(of, of_match); static struct platform_driver knav_dma_driver = { .probe = knav_dma_probe, - .remove = knav_dma_remove, + .remove_new = knav_dma_remove, .driver = { .name = "keystone-navigator-dma", .of_match_table = of_match, -- cgit v1.2.3 From af97160a0c5f1908c6f2830023fb93baac4451d3 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Mon, 25 Sep 2023 11:55:26 +0200 Subject: soc/ti: knav_qmss_queue: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-36-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon --- drivers/soc/ti/knav_qmss_queue.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/soc/ti') diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index 0f252c2549ba..cea791717957 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c @@ -1884,17 +1884,16 @@ err: return ret; } -static int knav_queue_remove(struct platform_device *pdev) +static void knav_queue_remove(struct platform_device *pdev) { /* TODO: Free resources */ pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - return 0; } static struct platform_driver keystone_qmss_driver = { .probe = knav_queue_probe, - .remove = knav_queue_remove, + .remove_new = knav_queue_remove, .driver = { .name = "keystone-navigator-qmss", .of_match_table = keystone_qmss_of_match, -- cgit v1.2.3 From 9eb950e9fffc5337bfe1798cf89ce4d97a4f1221 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Mon, 25 Sep 2023 11:55:27 +0200 Subject: soc/ti: pm33xx: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-37-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon --- drivers/soc/ti/pm33xx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/soc/ti') diff --git a/drivers/soc/ti/pm33xx.c b/drivers/soc/ti/pm33xx.c index f04c21157904..8e983c3c4e03 100644 --- a/drivers/soc/ti/pm33xx.c +++ b/drivers/soc/ti/pm33xx.c @@ -583,7 +583,7 @@ err_wkup_m3_ipc_put: return ret; } -static int am33xx_pm_remove(struct platform_device *pdev) +static void am33xx_pm_remove(struct platform_device *pdev) { pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); @@ -594,7 +594,6 @@ static int am33xx_pm_remove(struct platform_device *pdev) am33xx_pm_free_sram(); iounmap(rtc_base_virt); clk_put(rtc_fck); - return 0; } static struct platform_driver am33xx_pm_driver = { @@ -602,7 +601,7 @@ static struct platform_driver am33xx_pm_driver = { .name = "pm33xx", }, .probe = am33xx_pm_probe, - .remove = am33xx_pm_remove, + .remove_new = am33xx_pm_remove, }; module_platform_driver(am33xx_pm_driver); -- cgit v1.2.3 From d183b20d340b7c098f44cb5c02f4ced01cfd0b16 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Mon, 25 Sep 2023 11:55:28 +0200 Subject: soc/ti: pruss: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-38-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon --- drivers/soc/ti/pruss.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/soc/ti') diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c index f49f8492dde5..24a42e0b645c 100644 --- a/drivers/soc/ti/pruss.c +++ b/drivers/soc/ti/pruss.c @@ -565,7 +565,7 @@ rpm_disable: return ret; } -static int pruss_remove(struct platform_device *pdev) +static void pruss_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -573,8 +573,6 @@ static int pruss_remove(struct platform_device *pdev) pm_runtime_put_sync(dev); pm_runtime_disable(dev); - - return 0; } /* instance-specific driver private data */ @@ -610,7 +608,7 @@ static struct platform_driver pruss_driver = { .of_match_table = pruss_of_match, }, .probe = pruss_probe, - .remove = pruss_remove, + .remove_new = pruss_remove, }; module_platform_driver(pruss_driver); -- cgit v1.2.3 From ba03aab9bfb4c9d456419da3891375d45c6bfe15 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Mon, 25 Sep 2023 11:55:29 +0200 Subject: soc/ti: smartreflex: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-39-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon --- drivers/soc/ti/smartreflex.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/soc/ti') diff --git a/drivers/soc/ti/smartreflex.c b/drivers/soc/ti/smartreflex.c index 62b2f1464e46..d6219060b616 100644 --- a/drivers/soc/ti/smartreflex.c +++ b/drivers/soc/ti/smartreflex.c @@ -933,7 +933,7 @@ err_list_del: return ret; } -static int omap_sr_remove(struct platform_device *pdev) +static void omap_sr_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct omap_sr *sr_info = platform_get_drvdata(pdev); @@ -945,7 +945,6 @@ static int omap_sr_remove(struct platform_device *pdev) pm_runtime_disable(dev); clk_unprepare(sr_info->fck); list_del(&sr_info->node); - return 0; } static void omap_sr_shutdown(struct platform_device *pdev) @@ -970,7 +969,7 @@ MODULE_DEVICE_TABLE(of, omap_sr_match); static struct platform_driver smartreflex_driver = { .probe = omap_sr_probe, - .remove = omap_sr_remove, + .remove_new = omap_sr_remove, .shutdown = omap_sr_shutdown, .driver = { .name = DRIVER_NAME, -- cgit v1.2.3 From 82e83cb51c87b5bf3ab83f7c7b150c19400056c2 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Mon, 25 Sep 2023 11:55:30 +0200 Subject: soc/ti: wkup_m3_ipc: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-40-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon --- drivers/soc/ti/wkup_m3_ipc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/soc/ti') diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c index 3aff106fc11a..6a1c6b34c414 100644 --- a/drivers/soc/ti/wkup_m3_ipc.c +++ b/drivers/soc/ti/wkup_m3_ipc.c @@ -713,7 +713,7 @@ err_free_mbox: return ret; } -static int wkup_m3_ipc_remove(struct platform_device *pdev) +static void wkup_m3_ipc_remove(struct platform_device *pdev) { wkup_m3_ipc_dbg_destroy(m3_ipc_state); @@ -723,8 +723,6 @@ static int wkup_m3_ipc_remove(struct platform_device *pdev) rproc_put(m3_ipc_state->rproc); m3_ipc_state = NULL; - - return 0; } static int __maybe_unused wkup_m3_ipc_suspend(struct device *dev) @@ -760,7 +758,7 @@ MODULE_DEVICE_TABLE(of, wkup_m3_ipc_of_match); static struct platform_driver wkup_m3_ipc_driver = { .probe = wkup_m3_ipc_probe, - .remove = wkup_m3_ipc_remove, + .remove_new = wkup_m3_ipc_remove, .driver = { .name = "wkup_m3_ipc", .of_match_table = wkup_m3_ipc_of_match, -- cgit v1.2.3 From 50c01a942b287451ed7bec290ac09e07b91c6253 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 9 Oct 2023 16:13:43 -0500 Subject: soc: ti: knav_qmss_queue: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231009211356.3242037-13-robh@kernel.org Signed-off-by: Nishanth Menon --- drivers/soc/ti/knav_qmss_queue.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/soc/ti') diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index cea791717957..06fb5505c22c 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c @@ -14,10 +14,12 @@ #include #include #include +#include #include -#include #include +#include #include +#include #include #include @@ -1754,7 +1756,6 @@ static int knav_queue_probe(struct platform_device *pdev) { struct device_node *node = pdev->dev.of_node; struct device_node *qmgrs, *queue_pools, *regions, *pdsps; - const struct of_device_id *match; struct device *dev = &pdev->dev; u32 temp[2]; int ret; @@ -1770,8 +1771,7 @@ static int knav_queue_probe(struct platform_device *pdev) return -ENOMEM; } - match = of_match_device(of_match_ptr(keystone_qmss_of_match), dev); - if (match && match->data) + if (device_get_match_data(dev)) kdev->version = QMSS_66AK2G; platform_set_drvdata(pdev, kdev); -- cgit v1.2.3 From 8dec342ead710dace27dc82096144bf7a1011827 Mon Sep 17 00:00:00 2001 From: Neha Malcom Francis Date: Mon, 16 Oct 2023 15:46:06 +0530 Subject: soc: ti: k3-socinfo: Fix typo in bitfield documentation Fix documentation that indicates wrong bit. Signed-off-by: Neha Malcom Francis Link: https://lore.kernel.org/r/20231016101608.993921-2-n-francis@ti.com Signed-off-by: Nishanth Menon --- drivers/soc/ti/k3-socinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/soc/ti') diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c index 6ea9b8c7d335..d45f5cb955a6 100644 --- a/drivers/soc/ti/k3-socinfo.c +++ b/drivers/soc/ti/k3-socinfo.c @@ -20,7 +20,7 @@ * 31-28 VARIANT Device variant * 27-12 PARTNO Part number * 11-1 MFG Indicates TI as manufacturer (0x17) - * 1 Always 1 + * 0 Always 1 */ #define CTRLMMR_WKUP_JTAGID_VARIANT_SHIFT (28) #define CTRLMMR_WKUP_JTAGID_VARIANT_MASK GENMASK(31, 28) -- cgit v1.2.3 From 3aeb0d3694e16b5066db82aa1152884f2e6aace0 Mon Sep 17 00:00:00 2001 From: Neha Malcom Francis Date: Mon, 16 Oct 2023 15:46:07 +0530 Subject: soc: ti: k3-socinfo: Avoid overriding return value Avoid overriding the return value and make sure the right error code is reflected. If the part is none of the identified list present in k3_soc_ids[], return -ENODEV. Signed-off-by: Neha Malcom Francis Link: https://lore.kernel.org/r/20231016101608.993921-3-n-francis@ti.com Signed-off-by: Nishanth Menon --- drivers/soc/ti/k3-socinfo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/soc/ti') diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c index d45f5cb955a6..7fc3548e084c 100644 --- a/drivers/soc/ti/k3-socinfo.c +++ b/drivers/soc/ti/k3-socinfo.c @@ -60,7 +60,7 @@ k3_chipinfo_partno_to_names(unsigned int partno, return 0; } - return -EINVAL; + return -ENODEV; } static int k3_chipinfo_probe(struct platform_device *pdev) @@ -111,8 +111,7 @@ static int k3_chipinfo_probe(struct platform_device *pdev) ret = k3_chipinfo_partno_to_names(partno_id, soc_dev_attr); if (ret) { - dev_err(dev, "Unknown SoC JTAGID[0x%08X]\n", jtag_id); - ret = -ENODEV; + dev_err(dev, "Unknown SoC JTAGID[0x%08X]: %d\n", jtag_id, ret); goto err_free_rev; } -- cgit v1.2.3