From 3608a2cd818a8d97bd3d4dc32f6c0afaf09b15ec Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 7 Mar 2023 13:05:40 +0100 Subject: backlight: apple_bl: Use acpi_video_get_backlight_type() On some MacBooks both the apple_bl and the apple-gmux backlight drivers may be able to export a /sys/class/backlight device. To avoid having 2 backlight devices for one LCD panel until now the apple-gmux driver has been calling apple_bl_unregister() to move the apple_bl backlight device out of the way when it loads. Similar problems exist on other x86 laptops and all backlight drivers which may be used on x86 laptops have moved to using acpi_video_get_backlight_type() to determine whether they should load or not. Switch apple_bl to this model too, so that it is consistent with all the other x86 backlight drivers. Besides code-simplification and consistency this has 2 other benefits: 1) It removes a race during boot where userspace will briefly see an apple_bl backlight and then have it disappear again, leading to e.g.: https://bbs.archlinux.org/viewtopic.php?id=269920 2) This allows user to switch between the drivers by passing acpi_backlight=apple_gmux or acpi_backlight=vendor on the kernel commandline. Signed-off-by: Hans de Goede Reviewed-by: Daniel Thompson Acked-by: Lee Jones Link: https://lore.kernel.org/r/20230307120540.389920-1-hdegoede@redhat.com --- drivers/video/backlight/Kconfig | 1 + drivers/video/backlight/apple_bl.c | 31 ++++++++++--------------------- 2 files changed, 11 insertions(+), 21 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 4c33e971c0f0..51387b1ef012 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -285,6 +285,7 @@ config BACKLIGHT_MT6370 config BACKLIGHT_APPLE tristate "Apple Backlight Driver" depends on X86 && ACPI + depends on ACPI_VIDEO=n || ACPI_VIDEO help If you have an Intel-based Apple say Y to enable a driver for its backlight. diff --git a/drivers/video/backlight/apple_bl.c b/drivers/video/backlight/apple_bl.c index e9e7acb577bf..aaa824437a2a 100644 --- a/drivers/video/backlight/apple_bl.c +++ b/drivers/video/backlight/apple_bl.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include static struct backlight_device *apple_backlight_device; @@ -215,32 +215,21 @@ static struct acpi_driver apple_bl_driver = { }, }; -static atomic_t apple_bl_registered = ATOMIC_INIT(0); - -int apple_bl_register(void) -{ - if (atomic_xchg(&apple_bl_registered, 1) == 0) - return acpi_bus_register_driver(&apple_bl_driver); - - return 0; -} -EXPORT_SYMBOL_GPL(apple_bl_register); - -void apple_bl_unregister(void) -{ - if (atomic_xchg(&apple_bl_registered, 0) == 1) - acpi_bus_unregister_driver(&apple_bl_driver); -} -EXPORT_SYMBOL_GPL(apple_bl_unregister); - static int __init apple_bl_init(void) { - return apple_bl_register(); + /* + * Use ACPI video detection code to see if this driver should register + * or if another driver, e.g. the apple-gmux driver should be used. + */ + if (acpi_video_get_backlight_type() != acpi_backlight_vendor) + return -ENODEV; + + return acpi_bus_register_driver(&apple_bl_driver); } static void __exit apple_bl_exit(void) { - apple_bl_unregister(); + acpi_bus_unregister_driver(&apple_bl_driver); } module_init(apple_bl_init); -- cgit From 10258bf4534bf8123b5fa620f73fe69901857f69 Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Mon, 6 Feb 2023 20:58:30 +0100 Subject: backlight: qcom-wled: Add PMI8950 compatible PMI8950 contains WLED of version 4. Add support for it to the driver. Signed-off-by: Luca Weiss Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20221226-msm8953-6-2-wled-v1-1-e318d4c71d05@z3ntu.xyz --- drivers/video/backlight/qcom-wled.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/video') diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c index 527210e85795..5f504883aca5 100644 --- a/drivers/video/backlight/qcom-wled.c +++ b/drivers/video/backlight/qcom-wled.c @@ -1731,6 +1731,7 @@ static int wled_remove(struct platform_device *pdev) static const struct of_device_id wled_match_table[] = { { .compatible = "qcom,pm8941-wled", .data = (void *)3 }, + { .compatible = "qcom,pmi8950-wled", .data = (void *)4 }, { .compatible = "qcom,pmi8994-wled", .data = (void *)4 }, { .compatible = "qcom,pmi8998-wled", .data = (void *)4 }, { .compatible = "qcom,pm660l-wled", .data = (void *)4 }, -- cgit From 8b339caf4255a5cfafdc743be601100c5da6c304 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 8 Mar 2023 08:39:33 +0100 Subject: backlight: aat2870_bl: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230308073945.2336302-2-u.kleine-koenig@pengutronix.de --- drivers/video/backlight/aat2870_bl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/aat2870_bl.c b/drivers/video/backlight/aat2870_bl.c index 1cbb303e9c88..81fde3abb92c 100644 --- a/drivers/video/backlight/aat2870_bl.c +++ b/drivers/video/backlight/aat2870_bl.c @@ -178,7 +178,7 @@ out: return ret; } -static int aat2870_bl_remove(struct platform_device *pdev) +static void aat2870_bl_remove(struct platform_device *pdev) { struct aat2870_bl_driver_data *aat2870_bl = platform_get_drvdata(pdev); struct backlight_device *bd = aat2870_bl->bd; @@ -186,8 +186,6 @@ static int aat2870_bl_remove(struct platform_device *pdev) bd->props.power = FB_BLANK_POWERDOWN; bd->props.brightness = 0; backlight_update_status(bd); - - return 0; } static struct platform_driver aat2870_bl_driver = { @@ -195,7 +193,7 @@ static struct platform_driver aat2870_bl_driver = { .name = "aat2870-backlight", }, .probe = aat2870_bl_probe, - .remove = aat2870_bl_remove, + .remove_new = aat2870_bl_remove, }; static int __init aat2870_bl_init(void) -- cgit From 6879039167ff4b6805760f1c5935e93c92dc6aa4 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 8 Mar 2023 08:39:34 +0100 Subject: backlight: adp5520_bl: 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 (mostly) ignored 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. 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: Michael Hennerich Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230308073945.2336302-3-u.kleine-koenig@pengutronix.de --- drivers/video/backlight/adp5520_bl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c index 686988c3df3a..8e0e9cfe5fe9 100644 --- a/drivers/video/backlight/adp5520_bl.c +++ b/drivers/video/backlight/adp5520_bl.c @@ -337,7 +337,7 @@ static int adp5520_bl_probe(struct platform_device *pdev) return 0; } -static int adp5520_bl_remove(struct platform_device *pdev) +static void adp5520_bl_remove(struct platform_device *pdev) { struct backlight_device *bl = platform_get_drvdata(pdev); struct adp5520_bl *data = bl_get_data(bl); @@ -347,8 +347,6 @@ static int adp5520_bl_remove(struct platform_device *pdev) if (data->pdata->en_ambl_sens) sysfs_remove_group(&bl->dev.kobj, &adp5520_bl_attr_group); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -377,7 +375,7 @@ static struct platform_driver adp5520_bl_driver = { .pm = &adp5520_bl_pm_ops, }, .probe = adp5520_bl_probe, - .remove = adp5520_bl_remove, + .remove_new = adp5520_bl_remove, }; module_platform_driver(adp5520_bl_driver); -- cgit From f6672d7f0cff6ee8bd09851545b60e41099197ae Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 8 Mar 2023 08:39:35 +0100 Subject: backlight: cr_bllcd: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230308073945.2336302-4-u.kleine-koenig@pengutronix.de --- drivers/video/backlight/cr_bllcd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/cr_bllcd.c b/drivers/video/backlight/cr_bllcd.c index 4ad0a72531fe..781aeecc451d 100644 --- a/drivers/video/backlight/cr_bllcd.c +++ b/drivers/video/backlight/cr_bllcd.c @@ -210,7 +210,7 @@ static int cr_backlight_probe(struct platform_device *pdev) return 0; } -static int cr_backlight_remove(struct platform_device *pdev) +static void cr_backlight_remove(struct platform_device *pdev) { struct cr_panel *crp = platform_get_drvdata(pdev); @@ -220,13 +220,11 @@ static int cr_backlight_remove(struct platform_device *pdev) cr_backlight_set_intensity(crp->cr_backlight_device); cr_lcd_set_power(crp->cr_lcd_device, FB_BLANK_POWERDOWN); pci_dev_put(lpc_dev); - - return 0; } static struct platform_driver cr_backlight_driver = { .probe = cr_backlight_probe, - .remove = cr_backlight_remove, + .remove_new = cr_backlight_remove, .driver = { .name = "cr_backlight", }, -- cgit From 78a2bb4802071788ce2315f1c8002f10b121d33c Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 8 Mar 2023 08:39:36 +0100 Subject: backlight: da9052_bl: 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 (mostly) ignored 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. 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: Adam Ward Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230308073945.2336302-5-u.kleine-koenig@pengutronix.de --- drivers/video/backlight/da9052_bl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/da9052_bl.c b/drivers/video/backlight/da9052_bl.c index 882359dd288c..1cdc8543310b 100644 --- a/drivers/video/backlight/da9052_bl.c +++ b/drivers/video/backlight/da9052_bl.c @@ -135,7 +135,7 @@ static int da9052_backlight_probe(struct platform_device *pdev) return da9052_adjust_wled_brightness(wleds); } -static int da9052_backlight_remove(struct platform_device *pdev) +static void da9052_backlight_remove(struct platform_device *pdev) { struct backlight_device *bl = platform_get_drvdata(pdev); struct da9052_bl *wleds = bl_get_data(bl); @@ -143,8 +143,6 @@ static int da9052_backlight_remove(struct platform_device *pdev) wleds->brightness = 0; wleds->state = DA9052_WLEDS_OFF; da9052_adjust_wled_brightness(wleds); - - return 0; } static const struct platform_device_id da9052_wled_ids[] = { @@ -166,7 +164,7 @@ MODULE_DEVICE_TABLE(platform, da9052_wled_ids); static struct platform_driver da9052_wled_driver = { .probe = da9052_backlight_probe, - .remove = da9052_backlight_remove, + .remove_new = da9052_backlight_remove, .id_table = da9052_wled_ids, .driver = { .name = "da9052-wled", -- cgit From 7150f8c2aa9d28a9bdc2f67180df26af5896253d Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 8 Mar 2023 08:39:37 +0100 Subject: backlight: hp680_bl: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230308073945.2336302-6-u.kleine-koenig@pengutronix.de --- drivers/video/backlight/hp680_bl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/hp680_bl.c b/drivers/video/backlight/hp680_bl.c index 9123c33def05..ddb7ab4df77e 100644 --- a/drivers/video/backlight/hp680_bl.c +++ b/drivers/video/backlight/hp680_bl.c @@ -119,20 +119,18 @@ static int hp680bl_probe(struct platform_device *pdev) return 0; } -static int hp680bl_remove(struct platform_device *pdev) +static void hp680bl_remove(struct platform_device *pdev) { struct backlight_device *bd = platform_get_drvdata(pdev); bd->props.brightness = 0; bd->props.power = 0; hp680bl_send_intensity(bd); - - return 0; } static struct platform_driver hp680bl_driver = { .probe = hp680bl_probe, - .remove = hp680bl_remove, + .remove_new = hp680bl_remove, .driver = { .name = "hp680-bl", .pm = &hp680bl_pm_ops, -- cgit From c4c4fa57fd3cc00020152baa169337521f90b2ad Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 8 Mar 2023 08:39:38 +0100 Subject: backlight: led_bl: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230308073945.2336302-7-u.kleine-koenig@pengutronix.de --- drivers/video/backlight/led_bl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/led_bl.c b/drivers/video/backlight/led_bl.c index f54d256e2d54..a1b6a2ad73a0 100644 --- a/drivers/video/backlight/led_bl.c +++ b/drivers/video/backlight/led_bl.c @@ -217,7 +217,7 @@ static int led_bl_probe(struct platform_device *pdev) return 0; } -static int led_bl_remove(struct platform_device *pdev) +static void led_bl_remove(struct platform_device *pdev) { struct led_bl_data *priv = platform_get_drvdata(pdev); struct backlight_device *bl = priv->bl_dev; @@ -228,8 +228,6 @@ static int led_bl_remove(struct platform_device *pdev) led_bl_power_off(priv); for (i = 0; i < priv->nb_leds; i++) led_sysfs_enable(priv->leds[i]); - - return 0; } static const struct of_device_id led_bl_of_match[] = { @@ -245,7 +243,7 @@ static struct platform_driver led_bl_driver = { .of_match_table = of_match_ptr(led_bl_of_match), }, .probe = led_bl_probe, - .remove = led_bl_remove, + .remove_new = led_bl_remove, }; module_platform_driver(led_bl_driver); -- cgit From cba7dfe04f84f39e0fea353eec511b9ce8455e59 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 8 Mar 2023 08:39:39 +0100 Subject: backlight: lm3533_bl: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230308073945.2336302-8-u.kleine-koenig@pengutronix.de --- drivers/video/backlight/lm3533_bl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/lm3533_bl.c b/drivers/video/backlight/lm3533_bl.c index 1df1b6643c0b..3e10d480cb7f 100644 --- a/drivers/video/backlight/lm3533_bl.c +++ b/drivers/video/backlight/lm3533_bl.c @@ -337,7 +337,7 @@ err_sysfs_remove: return ret; } -static int lm3533_bl_remove(struct platform_device *pdev) +static void lm3533_bl_remove(struct platform_device *pdev) { struct lm3533_bl *bl = platform_get_drvdata(pdev); struct backlight_device *bd = bl->bd; @@ -349,8 +349,6 @@ static int lm3533_bl_remove(struct platform_device *pdev) lm3533_ctrlbank_disable(&bl->cb); sysfs_remove_group(&bd->dev.kobj, &lm3533_bl_attribute_group); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -390,7 +388,7 @@ static struct platform_driver lm3533_bl_driver = { .pm = &lm3533_bl_pm_ops, }, .probe = lm3533_bl_probe, - .remove = lm3533_bl_remove, + .remove_new = lm3533_bl_remove, .shutdown = lm3533_bl_shutdown, }; module_platform_driver(lm3533_bl_driver); -- cgit From 1c708d346c15e2cd2e0f701e6df04094d1b544ca Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 8 Mar 2023 08:39:40 +0100 Subject: backlight: lp8788_bl: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230308073945.2336302-9-u.kleine-koenig@pengutronix.de --- drivers/video/backlight/lp8788_bl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/lp8788_bl.c b/drivers/video/backlight/lp8788_bl.c index ba42f3fe0c73..d1a14b0db265 100644 --- a/drivers/video/backlight/lp8788_bl.c +++ b/drivers/video/backlight/lp8788_bl.c @@ -298,7 +298,7 @@ err_dev: return ret; } -static int lp8788_backlight_remove(struct platform_device *pdev) +static void lp8788_backlight_remove(struct platform_device *pdev) { struct lp8788_bl *bl = platform_get_drvdata(pdev); struct backlight_device *bl_dev = bl->bl_dev; @@ -307,13 +307,11 @@ static int lp8788_backlight_remove(struct platform_device *pdev) backlight_update_status(bl_dev); sysfs_remove_group(&pdev->dev.kobj, &lp8788_attr_group); lp8788_backlight_unregister(bl); - - return 0; } static struct platform_driver lp8788_bl_driver = { .probe = lp8788_backlight_probe, - .remove = lp8788_backlight_remove, + .remove_new = lp8788_backlight_remove, .driver = { .name = LP8788_DEV_BACKLIGHT, }, -- cgit From 519e5cc52946c62878b4b4a7ef9f79fcb8164c52 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 8 Mar 2023 08:39:41 +0100 Subject: backlight: mt6370-backlight: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230308073945.2336302-10-u.kleine-koenig@pengutronix.de --- drivers/video/backlight/mt6370-backlight.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/mt6370-backlight.c b/drivers/video/backlight/mt6370-backlight.c index 623d4f2baca2..94422c956453 100644 --- a/drivers/video/backlight/mt6370-backlight.c +++ b/drivers/video/backlight/mt6370-backlight.c @@ -318,15 +318,13 @@ static int mt6370_bl_probe(struct platform_device *pdev) return 0; } -static int mt6370_bl_remove(struct platform_device *pdev) +static void mt6370_bl_remove(struct platform_device *pdev) { struct mt6370_priv *priv = platform_get_drvdata(pdev); struct backlight_device *bl_dev = priv->bl; bl_dev->props.brightness = 0; backlight_update_status(priv->bl); - - return 0; } static const struct of_device_id mt6370_bl_of_match[] = { @@ -342,7 +340,7 @@ static struct platform_driver mt6370_bl_driver = { .of_match_table = mt6370_bl_of_match, }, .probe = mt6370_bl_probe, - .remove = mt6370_bl_remove, + .remove_new = mt6370_bl_remove, }; module_platform_driver(mt6370_bl_driver); -- cgit From 0a4606a7a4bc6f876354ff6d90b969172208eeef Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 8 Mar 2023 08:39:42 +0100 Subject: backlight: pwm_bl: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230308073945.2336302-11-u.kleine-koenig@pengutronix.de --- drivers/video/backlight/pwm_bl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index fb388148d98f..fce412234d10 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -625,7 +625,7 @@ err_alloc: return ret; } -static int pwm_backlight_remove(struct platform_device *pdev) +static void pwm_backlight_remove(struct platform_device *pdev) { struct backlight_device *bl = platform_get_drvdata(pdev); struct pwm_bl_data *pb = bl_get_data(bl); @@ -635,8 +635,6 @@ static int pwm_backlight_remove(struct platform_device *pdev) if (pb->exit) pb->exit(&pdev->dev); - - return 0; } static void pwm_backlight_shutdown(struct platform_device *pdev) @@ -690,7 +688,7 @@ static struct platform_driver pwm_backlight_driver = { .of_match_table = of_match_ptr(pwm_backlight_of_match), }, .probe = pwm_backlight_probe, - .remove = pwm_backlight_remove, + .remove_new = pwm_backlight_remove, .shutdown = pwm_backlight_shutdown, }; -- cgit From ea379bc80231c8a86730f854e436eff19a729950 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 8 Mar 2023 08:39:43 +0100 Subject: backlight: qcom-wled: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230308073945.2336302-12-u.kleine-koenig@pengutronix.de --- drivers/video/backlight/qcom-wled.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c index 5f504883aca5..c6996aa288e6 100644 --- a/drivers/video/backlight/qcom-wled.c +++ b/drivers/video/backlight/qcom-wled.c @@ -1717,7 +1717,7 @@ static int wled_probe(struct platform_device *pdev) return PTR_ERR_OR_ZERO(bl); }; -static int wled_remove(struct platform_device *pdev) +static void wled_remove(struct platform_device *pdev) { struct wled *wled = platform_get_drvdata(pdev); @@ -1725,8 +1725,6 @@ static int wled_remove(struct platform_device *pdev) cancel_delayed_work_sync(&wled->ovp_work); disable_irq(wled->short_irq); disable_irq(wled->ovp_irq); - - return 0; } static const struct of_device_id wled_match_table[] = { @@ -1743,7 +1741,7 @@ MODULE_DEVICE_TABLE(of, wled_match_table); static struct platform_driver wled_driver = { .probe = wled_probe, - .remove = wled_remove, + .remove_new = wled_remove, .driver = { .name = "qcom,wled", .of_match_table = wled_match_table, -- cgit From 20c111d2e18c7318a9f2ae815c84ea0a9218317e Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 8 Mar 2023 08:39:44 +0100 Subject: backlight: rt4831-backlight: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230308073945.2336302-13-u.kleine-koenig@pengutronix.de --- drivers/video/backlight/rt4831-backlight.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/rt4831-backlight.c b/drivers/video/backlight/rt4831-backlight.c index eb8c59e8713f..7d1af4c2ca67 100644 --- a/drivers/video/backlight/rt4831-backlight.c +++ b/drivers/video/backlight/rt4831-backlight.c @@ -203,15 +203,13 @@ static int rt4831_bl_probe(struct platform_device *pdev) return 0; } -static int rt4831_bl_remove(struct platform_device *pdev) +static void rt4831_bl_remove(struct platform_device *pdev) { struct rt4831_priv *priv = platform_get_drvdata(pdev); struct backlight_device *bl_dev = priv->bl; bl_dev->props.brightness = 0; backlight_update_status(priv->bl); - - return 0; } static const struct of_device_id __maybe_unused rt4831_bl_of_match[] = { @@ -226,7 +224,7 @@ static struct platform_driver rt4831_bl_driver = { .of_match_table = rt4831_bl_of_match, }, .probe = rt4831_bl_probe, - .remove = rt4831_bl_remove, + .remove_new = rt4831_bl_remove, }; module_platform_driver(rt4831_bl_driver); -- cgit From 541ec23c603dcb3b9cebebe40d9a68cdc89dd36b Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 8 Mar 2023 08:39:45 +0100 Subject: backlight: sky81452-backlight: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230308073945.2336302-14-u.kleine-koenig@pengutronix.de --- drivers/video/backlight/sky81452-backlight.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c index 0172438c38ce..eb18c6eb0ff0 100644 --- a/drivers/video/backlight/sky81452-backlight.c +++ b/drivers/video/backlight/sky81452-backlight.c @@ -311,7 +311,7 @@ static int sky81452_bl_probe(struct platform_device *pdev) return ret; } -static int sky81452_bl_remove(struct platform_device *pdev) +static void sky81452_bl_remove(struct platform_device *pdev) { const struct sky81452_bl_platform_data *pdata = dev_get_platdata(&pdev->dev); @@ -325,8 +325,6 @@ static int sky81452_bl_remove(struct platform_device *pdev) if (pdata->gpiod_enable) gpiod_set_value_cansleep(pdata->gpiod_enable, 0); - - return 0; } #ifdef CONFIG_OF @@ -343,7 +341,7 @@ static struct platform_driver sky81452_bl_driver = { .of_match_table = of_match_ptr(sky81452_bl_of_match), }, .probe = sky81452_bl_probe, - .remove = sky81452_bl_remove, + .remove_new = sky81452_bl_remove, }; module_platform_driver(sky81452_bl_driver); -- cgit From c857b87202bf5266b45c5b4dc0308aa603aeb262 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sat, 11 Mar 2023 18:35:55 +0100 Subject: backlight: lp855x: Mark OF related data as maybe unused MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The driver can be compile tested with !CONFIG_OF making certain data unused: drivers/video/backlight/lp855x_bl.c:551:34: error: ‘lp855x_dt_ids’ defined but not used [-Werror=unused-const-variable=] Signed-off-by: Krzysztof Kozlowski Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230311173556.263086-1-krzysztof.kozlowski@linaro.org --- drivers/video/backlight/lp855x_bl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c index 81012bf29baf..a57c9ef3b1cc 100644 --- a/drivers/video/backlight/lp855x_bl.c +++ b/drivers/video/backlight/lp855x_bl.c @@ -548,7 +548,7 @@ static void lp855x_remove(struct i2c_client *cl) sysfs_remove_group(&lp->dev->kobj, &lp855x_attr_group); } -static const struct of_device_id lp855x_dt_ids[] = { +static const struct of_device_id lp855x_dt_ids[] __maybe_unused = { { .compatible = "ti,lp8550", }, { .compatible = "ti,lp8551", }, { .compatible = "ti,lp8552", }, -- cgit From a884cdf5dc27b489c3e9daf4c095b72e6cc38dae Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sat, 11 Mar 2023 18:35:56 +0100 Subject: backlight: arcxcnn_bl: Drop of_match_ptr for ID table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The driver will match mostly by DT table (even thought there is regular ID table) so there is little benefit in of_match_ptr (this also allows ACPI matching via PRP0001, even though it might not be relevant here). drivers/video/backlight/arcxcnn_bl.c:378:34: error: ‘arcxcnn_dt_ids’ defined but not used [-Werror=unused-const-variable=] Signed-off-by: Krzysztof Kozlowski Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230311173556.263086-2-krzysztof.kozlowski@linaro.org --- drivers/video/backlight/arcxcnn_bl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/arcxcnn_bl.c b/drivers/video/backlight/arcxcnn_bl.c index e610d7a1d13d..088bcca547dd 100644 --- a/drivers/video/backlight/arcxcnn_bl.c +++ b/drivers/video/backlight/arcxcnn_bl.c @@ -390,7 +390,7 @@ MODULE_DEVICE_TABLE(i2c, arcxcnn_ids); static struct i2c_driver arcxcnn_driver = { .driver = { .name = "arcxcnn_bl", - .of_match_table = of_match_ptr(arcxcnn_dt_ids), + .of_match_table = arcxcnn_dt_ids, }, .probe_new = arcxcnn_probe, .remove = arcxcnn_remove, -- cgit From 796bf946c42644b047c5ad5575906ff9c397fbda Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Fri, 10 Mar 2023 08:47:30 -0600 Subject: backlight: hx8357: Use of_property_present() for testing DT property presence It is preferred to use typed property access functions (i.e. of_property_read_ functions) rather than low-level of_get_property/of_find_property functions for reading properties. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more. Signed-off-by: Rob Herring Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230310144730.1546101-1-robh@kernel.org --- drivers/video/backlight/hx8357.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c index 9b50bc96e00f..f76d2469d490 100644 --- a/drivers/video/backlight/hx8357.c +++ b/drivers/video/backlight/hx8357.c @@ -617,7 +617,7 @@ static int hx8357_probe(struct spi_device *spi) return -EINVAL; } - if (of_find_property(spi->dev.of_node, "im-gpios", NULL)) { + if (of_property_present(spi->dev.of_node, "im-gpios")) { lcd->use_im_pins = 1; for (i = 0; i < HX8357_NUM_IM_PINS; i++) { -- cgit From fb200218b40b7864f64f1a47de61e035d8934e92 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Fri, 10 Mar 2023 08:47:31 -0600 Subject: backlight: as3711: Use of_property_read_bool() for boolean properties It is preferred to use typed property access functions (i.e. of_property_read_ functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to of_property_read_bool(). Signed-off-by: Rob Herring Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230310144731.1546190-1-robh@kernel.org --- drivers/video/backlight/as3711_bl.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/as3711_bl.c b/drivers/video/backlight/as3711_bl.c index 3b60019cdc2b..28437c2da0f5 100644 --- a/drivers/video/backlight/as3711_bl.c +++ b/drivers/video/backlight/as3711_bl.c @@ -286,23 +286,23 @@ static int as3711_backlight_parse_dt(struct device *dev) if (ret < 0) goto err_put_bl; - if (of_find_property(bl, "su2-feedback-voltage", NULL)) { + if (of_property_read_bool(bl, "su2-feedback-voltage")) { pdata->su2_feedback = AS3711_SU2_VOLTAGE; count++; } - if (of_find_property(bl, "su2-feedback-curr1", NULL)) { + if (of_property_read_bool(bl, "su2-feedback-curr1")) { pdata->su2_feedback = AS3711_SU2_CURR1; count++; } - if (of_find_property(bl, "su2-feedback-curr2", NULL)) { + if (of_property_read_bool(bl, "su2-feedback-curr2")) { pdata->su2_feedback = AS3711_SU2_CURR2; count++; } - if (of_find_property(bl, "su2-feedback-curr3", NULL)) { + if (of_property_read_bool(bl, "su2-feedback-curr3")) { pdata->su2_feedback = AS3711_SU2_CURR3; count++; } - if (of_find_property(bl, "su2-feedback-curr-auto", NULL)) { + if (of_property_read_bool(bl, "su2-feedback-curr-auto")) { pdata->su2_feedback = AS3711_SU2_CURR_AUTO; count++; } @@ -312,19 +312,19 @@ static int as3711_backlight_parse_dt(struct device *dev) } count = 0; - if (of_find_property(bl, "su2-fbprot-lx-sd4", NULL)) { + if (of_property_read_bool(bl, "su2-fbprot-lx-sd4")) { pdata->su2_fbprot = AS3711_SU2_LX_SD4; count++; } - if (of_find_property(bl, "su2-fbprot-gpio2", NULL)) { + if (of_property_read_bool(bl, "su2-fbprot-gpio2")) { pdata->su2_fbprot = AS3711_SU2_GPIO2; count++; } - if (of_find_property(bl, "su2-fbprot-gpio3", NULL)) { + if (of_property_read_bool(bl, "su2-fbprot-gpio3")) { pdata->su2_fbprot = AS3711_SU2_GPIO3; count++; } - if (of_find_property(bl, "su2-fbprot-gpio4", NULL)) { + if (of_property_read_bool(bl, "su2-fbprot-gpio4")) { pdata->su2_fbprot = AS3711_SU2_GPIO4; count++; } @@ -334,15 +334,15 @@ static int as3711_backlight_parse_dt(struct device *dev) } count = 0; - if (of_find_property(bl, "su2-auto-curr1", NULL)) { + if (of_property_read_bool(bl, "su2-auto-curr1")) { pdata->su2_auto_curr1 = true; count++; } - if (of_find_property(bl, "su2-auto-curr2", NULL)) { + if (of_property_read_bool(bl, "su2-auto-curr2")) { pdata->su2_auto_curr2 = true; count++; } - if (of_find_property(bl, "su2-auto-curr3", NULL)) { + if (of_property_read_bool(bl, "su2-auto-curr3")) { pdata->su2_auto_curr3 = true; count++; } -- cgit From 1aaba11da9aa7d7d6b52a74d45b31cac118295a1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 13 Mar 2023 19:18:35 +0100 Subject: driver core: class: remove module * from class_create() The module pointer in class_create() never actually did anything, and it shouldn't have been requred to be set as a parameter even if it did something. So just remove it and fix up all callers of the function in the kernel tree at the same time. Cc: "Rafael J. Wysocki" Acked-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20230313181843.1207845-4-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- drivers/video/backlight/backlight.c | 2 +- drivers/video/backlight/lcd.c | 2 +- drivers/video/fbdev/core/fbmem.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 6eea72aa8dbf..9a885d398c22 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -751,7 +751,7 @@ static void __exit backlight_class_exit(void) static int __init backlight_class_init(void) { - backlight_class = class_create(THIS_MODULE, "backlight"); + backlight_class = class_create("backlight"); if (IS_ERR(backlight_class)) { pr_warn("Unable to create backlight class; errno = %ld\n", PTR_ERR(backlight_class)); diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index db56e465aaff..77c5cb2a44e2 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c @@ -323,7 +323,7 @@ static void __exit lcd_class_exit(void) static int __init lcd_class_init(void) { - lcd_class = class_create(THIS_MODULE, "lcd"); + lcd_class = class_create("lcd"); if (IS_ERR(lcd_class)) { pr_warn("Unable to create backlight class; errno = %ld\n", PTR_ERR(lcd_class)); diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 875541ff185b..b073795d99d0 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1749,7 +1749,7 @@ fbmem_init(void) goto err_chrdev; } - fb_class = class_create(THIS_MODULE, "graphics"); + fb_class = class_create("graphics"); if (IS_ERR(fb_class)) { ret = PTR_ERR(fb_class); pr_warn("Unable to create fb class; errno = %d\n", ret); -- cgit From 23baf831a32c04f9a968812511540b1b3e648bf5 Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Wed, 15 Mar 2023 14:31:33 +0300 Subject: mm, treewide: redefine MAX_ORDER sanely MAX_ORDER currently defined as number of orders page allocator supports: user can ask buddy allocator for page order between 0 and MAX_ORDER-1. This definition is counter-intuitive and lead to number of bugs all over the kernel. Change the definition of MAX_ORDER to be inclusive: the range of orders user can ask from buddy allocator is 0..MAX_ORDER now. [kirill@shutemov.name: fix min() warning] Link: https://lkml.kernel.org/r/20230315153800.32wib3n5rickolvh@box [akpm@linux-foundation.org: fix another min_t warning] [kirill@shutemov.name: fixups per Zi Yan] Link: https://lkml.kernel.org/r/20230316232144.b7ic4cif4kjiabws@box.shutemov.name [akpm@linux-foundation.org: fix underlining in docs] Link: https://lore.kernel.org/oe-kbuild-all/202303191025.VRCTk6mP-lkp@intel.com/ Link: https://lkml.kernel.org/r/20230315113133.11326-11-kirill.shutemov@linux.intel.com Signed-off-by: Kirill A. Shutemov Reviewed-by: Michael Ellerman [powerpc] Cc: "Kirill A. Shutemov" Cc: Zi Yan Signed-off-by: Andrew Morton --- drivers/video/fbdev/hyperv_fb.c | 4 ++-- drivers/video/fbdev/vermilion/vermilion.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c index ec3f6cf05f8c..34781dec3856 100644 --- a/drivers/video/fbdev/hyperv_fb.c +++ b/drivers/video/fbdev/hyperv_fb.c @@ -946,7 +946,7 @@ static phys_addr_t hvfb_get_phymem(struct hv_device *hdev, if (request_size == 0) return -1; - if (order < MAX_ORDER) { + if (order <= MAX_ORDER) { /* Call alloc_pages if the size is less than 2^MAX_ORDER */ page = alloc_pages(GFP_KERNEL | __GFP_ZERO, order); if (!page) @@ -977,7 +977,7 @@ static void hvfb_release_phymem(struct hv_device *hdev, { unsigned int order = get_order(size); - if (order < MAX_ORDER) + if (order <= MAX_ORDER) __free_pages(pfn_to_page(paddr >> PAGE_SHIFT), order); else dma_free_coherent(&hdev->device, diff --git a/drivers/video/fbdev/vermilion/vermilion.c b/drivers/video/fbdev/vermilion/vermilion.c index 0374ee6b6d03..32e74e02a02f 100644 --- a/drivers/video/fbdev/vermilion/vermilion.c +++ b/drivers/video/fbdev/vermilion/vermilion.c @@ -197,7 +197,7 @@ static int vmlfb_alloc_vram(struct vml_info *vinfo, va = &vinfo->vram[i]; order = 0; - while (requested > (PAGE_SIZE << order) && order < MAX_ORDER) + while (requested > (PAGE_SIZE << order) && order <= MAX_ORDER) order++; err = vmlfb_alloc_vram_area(va, order, 0); -- cgit From 6fd33a3333c7916689b8f051a185defe4dd515b0 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Tue, 4 Apr 2023 21:39:34 +0200 Subject: fbmem: Reject FB_ACTIVATE_KD_TEXT from userspace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an oversight from dc5bdb68b5b3 ("drm/fb-helper: Fix vt restore") - I failed to realize that nasty userspace could set this. It's not pretty to mix up kernel-internal and userspace uapi flags like this, but since the entire fb_var_screeninfo structure is uapi we'd need to either add a new parameter to the ->fb_set_par callback and fb_set_par() function, which has a _lot_ of users. Or some other fairly ugly side-channel int fb_info. Neither is a pretty prospect. Instead just correct the issue at hand by filtering out this kernel-internal flag in the ioctl handling code. Reviewed-by: Javier Martinez Canillas Acked-by: Maarten Lankhorst Signed-off-by: Daniel Vetter Fixes: dc5bdb68b5b3 ("drm/fb-helper: Fix vt restore") Cc: Alex Deucher Cc: shlomo@fastmail.com Cc: Michel Dänzer Cc: Noralf Trønnes Cc: Thomas Zimmermann Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: # v5.7+ Cc: Bartlomiej Zolnierkiewicz Cc: Geert Uytterhoeven Cc: Nathan Chancellor Cc: Qiujun Huang Cc: Peter Rosin Cc: linux-fbdev@vger.kernel.org Cc: Helge Deller Cc: Sam Ravnborg Cc: Geert Uytterhoeven Cc: Samuel Thibault Cc: Tetsuo Handa Cc: Shigeru Yoshida Link: https://patchwork.freedesktop.org/patch/msgid/20230404193934.472457-1-daniel.vetter@ffwll.ch --- drivers/video/fbdev/core/fbmem.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 875541ff185b..3fd95a79e4c3 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1116,6 +1116,8 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, case FBIOPUT_VSCREENINFO: if (copy_from_user(&var, argp, sizeof(var))) return -EFAULT; + /* only for kernel-internal use */ + var.activate &= ~FB_ACTIVATE_KD_TEXT; console_lock(); lock_fb_info(info); ret = fbcon_modechange_possible(info, &var); -- cgit From edf79dd2172233452ff142dcc98b19d955fc8974 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 12 Apr 2023 17:23:49 +0200 Subject: fbcon: Fix error paths in set_con2fb_map This is a regressoin introduced in b07db3958485 ("fbcon: Ditch error handling for con2fb_release_oldinfo"). I failed to realize what the if (!err) checks. The mentioned commit was dropping the con2fb_release_oldinfo() return value but the if (!err) was also checking whether the con2fb_acquire_newinfo() function call above failed or not. Fix this with an early return statement. Note that there's still a difference compared to the orginal state of the code, the below lines are now also skipped on error: if (!search_fb_in_map(info_idx)) info_idx = newidx; These are only needed when we've actually thrown out an old fb_info from the console mappings, which only happens later on. Also move the fbcon_add_cursor_work() call into the same if block, it's all protected by console_lock so doesn't matter when we set up the blinking cursor delayed work anyway. This further simplifies the control flow and allows us to ditch the found local variable. v2: Clarify commit message (Javier) Signed-off-by: Daniel Vetter Reviewed-by: Javier Martinez Canillas Acked-by: Helge Deller Tested-by: Xingyuan Mo Fixes: b07db3958485 ("fbcon: Ditch error handling for con2fb_release_oldinfo") Cc: Thomas Zimmermann Cc: Sam Ravnborg Cc: Xingyuan Mo Cc: Thomas Zimmermann Cc: Helge Deller Cc: # v5.19+ --- drivers/video/fbdev/core/fbcon.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 0a2c47df01f4..52f6ce8e794a 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -823,7 +823,7 @@ static int set_con2fb_map(int unit, int newidx, int user) int oldidx = con2fb_map[unit]; struct fb_info *info = fbcon_registered_fb[newidx]; struct fb_info *oldinfo = NULL; - int found, err = 0, show_logo; + int err = 0, show_logo; WARN_CONSOLE_UNLOCKED(); @@ -841,26 +841,25 @@ static int set_con2fb_map(int unit, int newidx, int user) if (oldidx != -1) oldinfo = fbcon_registered_fb[oldidx]; - found = search_fb_in_map(newidx); - - if (!err && !found) { + if (!search_fb_in_map(newidx)) { err = con2fb_acquire_newinfo(vc, info, unit); - if (!err) - con2fb_map[unit] = newidx; + if (err) + return err; + + con2fb_map[unit] = newidx; + fbcon_add_cursor_work(info); } /* * If old fb is not mapped to any of the consoles, * fbcon should release it. */ - if (!err && oldinfo && !search_fb_in_map(oldidx)) + if (oldinfo && !search_fb_in_map(oldidx)) con2fb_release_oldinfo(vc, oldinfo, info); show_logo = (fg_console == 0 && !user && logo_shown != FBCON_LOGO_DONTSHOW); - if (!found) - fbcon_add_cursor_work(info); con2fb_map_boot[unit] = newidx; con2fb_init_display(vc, info, unit, show_logo); -- cgit From fffb0b52d5258554c645c966c6cbef7de50b851d Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 12 Apr 2023 17:31:46 +0200 Subject: fbcon: set_con2fb_map needs to set con2fb_map! I got really badly confused in d443d9386472 ("fbcon: move more common code into fb_open()") because we set the con2fb_map before the failure points, which didn't look good. But in trying to fix that I moved the assignment into the wrong path - we need to do it for _all_ vc we take over, not just the first one (which additionally requires the call to con2fb_acquire_newinfo). I've figured this out because of a KASAN bug report, where the fbcon_registered_fb and fbcon_display arrays went out of sync in fbcon_mode_deleted() because the con2fb_map pointed at the old fb_info, but the modes and everything was updated for the new one. Signed-off-by: Daniel Vetter Reviewed-by: Javier Martinez Canillas Acked-by: Helge Deller Tested-by: Xingyuan Mo Fixes: d443d9386472 ("fbcon: move more common code into fb_open()") Reported-by: Xingyuan Mo Cc: Thomas Zimmermann Cc: Sam Ravnborg Cc: Xingyuan Mo Cc: Thomas Zimmermann Cc: Helge Deller Cc: # v5.19+ --- drivers/video/fbdev/core/fbcon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 52f6ce8e794a..eb565a10e5cd 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -846,10 +846,11 @@ static int set_con2fb_map(int unit, int newidx, int user) if (err) return err; - con2fb_map[unit] = newidx; fbcon_add_cursor_work(info); } + con2fb_map[unit] = newidx; + /* * If old fb is not mapped to any of the consoles, * fbcon should release it. -- cgit From 6d398e69b9723cef9d9b1a735be34aef56e9e3a7 Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Tue, 7 Mar 2023 18:01:22 +0000 Subject: video: fbdev: remove MODULE_LICENSE in non-modules Since commit 8b41fc4454e ("kbuild: create modules.builtin without Makefile.modbuiltin or tristate.conf"), MODULE_LICENSE declarations are used to identify modules. As a consequence, uses of the macro in non-modules will cause modprobe to misidentify their containing object file as a module when it is not (false positives), and modprobe might succeed rather than failing with a suitable error message. So remove it in the files in this commit, none of which can be built as modules. Signed-off-by: Nick Alcock Suggested-by: Luis Chamberlain Cc: Luis Chamberlain Cc: linux-modules@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Hitomi Hasegawa Cc: Helge Deller Cc: linux-arm-kernel@lists.infradead.org Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Luis Chamberlain --- drivers/video/fbdev/wm8505fb.c | 1 - drivers/video/fbdev/wmt_ge_rops.c | 1 - 2 files changed, 2 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/wm8505fb.c b/drivers/video/fbdev/wm8505fb.c index 8f4d674fa0d0..2a2997c647f7 100644 --- a/drivers/video/fbdev/wm8505fb.c +++ b/drivers/video/fbdev/wm8505fb.c @@ -407,5 +407,4 @@ module_platform_driver(wm8505fb_driver); MODULE_AUTHOR("Ed Spiridonov "); MODULE_DESCRIPTION("Framebuffer driver for WMT WM8505"); -MODULE_LICENSE("GPL v2"); MODULE_DEVICE_TABLE(of, wmt_dt_ids); diff --git a/drivers/video/fbdev/wmt_ge_rops.c b/drivers/video/fbdev/wmt_ge_rops.c index 42255d27a1db..c207fd917dce 100644 --- a/drivers/video/fbdev/wmt_ge_rops.c +++ b/drivers/video/fbdev/wmt_ge_rops.c @@ -170,5 +170,4 @@ module_platform_driver(wmt_ge_rops_driver); MODULE_AUTHOR("Alexey Charkov "); MODULE_DESCRIPTION("Accelerators for raster operations using " "WonderMedia Graphics Engine"); -MODULE_LICENSE("GPL v2"); MODULE_DEVICE_TABLE(of, wmt_dt_ids); -- cgit From 2d419df353d2558544c894509304acf7753bb4f7 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:44 +0100 Subject: fbdev: cg14: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/cg14.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/cg14.c b/drivers/video/fbdev/cg14.c index 6a745eb46ca1..a028ede39c12 100644 --- a/drivers/video/fbdev/cg14.c +++ b/drivers/video/fbdev/cg14.c @@ -569,7 +569,7 @@ out_err: return err; } -static int cg14_remove(struct platform_device *op) +static void cg14_remove(struct platform_device *op) { struct fb_info *info = dev_get_drvdata(&op->dev); struct cg14_par *par = info->par; @@ -580,8 +580,6 @@ static int cg14_remove(struct platform_device *op) cg14_unmap_regs(op, info, par); framebuffer_release(info); - - return 0; } static const struct of_device_id cg14_match[] = { @@ -598,7 +596,7 @@ static struct platform_driver cg14_driver = { .of_match_table = cg14_match, }, .probe = cg14_probe, - .remove = cg14_remove, + .remove_new = cg14_remove, }; static int __init cg14_init(void) -- cgit From dd65e6f3fad96150cf54f8757f71884127ec4376 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:45 +0100 Subject: fbdev: cg3: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/cg3.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/cg3.c b/drivers/video/fbdev/cg3.c index 3a37fff4df36..6335cd364c74 100644 --- a/drivers/video/fbdev/cg3.c +++ b/drivers/video/fbdev/cg3.c @@ -434,7 +434,7 @@ out_err: return err; } -static int cg3_remove(struct platform_device *op) +static void cg3_remove(struct platform_device *op) { struct fb_info *info = dev_get_drvdata(&op->dev); struct cg3_par *par = info->par; @@ -446,8 +446,6 @@ static int cg3_remove(struct platform_device *op) of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len); framebuffer_release(info); - - return 0; } static const struct of_device_id cg3_match[] = { @@ -467,7 +465,7 @@ static struct platform_driver cg3_driver = { .of_match_table = cg3_match, }, .probe = cg3_probe, - .remove = cg3_remove, + .remove_new = cg3_remove, }; static int __init cg3_init(void) -- cgit From 2a50e4a1e685f9703763ee4a13f7bc622eecf79e Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:46 +0100 Subject: fbdev: cg6: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/cg6.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/cg6.c b/drivers/video/fbdev/cg6.c index 97ef43c25974..6884572efea1 100644 --- a/drivers/video/fbdev/cg6.c +++ b/drivers/video/fbdev/cg6.c @@ -828,7 +828,7 @@ out_err: return err; } -static int cg6_remove(struct platform_device *op) +static void cg6_remove(struct platform_device *op) { struct fb_info *info = dev_get_drvdata(&op->dev); struct cg6_par *par = info->par; @@ -839,8 +839,6 @@ static int cg6_remove(struct platform_device *op) cg6_unmap_regs(op, info, par); framebuffer_release(info); - - return 0; } static const struct of_device_id cg6_match[] = { @@ -860,7 +858,7 @@ static struct platform_driver cg6_driver = { .of_match_table = cg6_match, }, .probe = cg6_probe, - .remove = cg6_remove, + .remove_new = cg6_remove, }; static int __init cg6_init(void) -- cgit From fdc757fe7cb0f14dff4dc43c843a453d6bc41a48 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:47 +0100 Subject: fbdev: clps711x-fb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/clps711x-fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/clps711x-fb.c b/drivers/video/fbdev/clps711x-fb.c index c8bfc608bd9c..ac0d058152a3 100644 --- a/drivers/video/fbdev/clps711x-fb.c +++ b/drivers/video/fbdev/clps711x-fb.c @@ -350,7 +350,7 @@ out_fb_release: return ret; } -static int clps711x_fb_remove(struct platform_device *pdev) +static void clps711x_fb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); struct clps711x_fb_info *cfb = info->par; @@ -360,8 +360,6 @@ static int clps711x_fb_remove(struct platform_device *pdev) unregister_framebuffer(info); fb_dealloc_cmap(&info->cmap); framebuffer_release(info); - - return 0; } static const struct of_device_id clps711x_fb_dt_ids[] = { @@ -376,7 +374,7 @@ static struct platform_driver clps711x_fb_driver = { .of_match_table = clps711x_fb_dt_ids, }, .probe = clps711x_fb_probe, - .remove = clps711x_fb_remove, + .remove_new = clps711x_fb_remove, }; module_platform_driver(clps711x_fb_driver); -- cgit From ac40ac6ca0fae749417819d9081d79886b1154a4 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:48 +0100 Subject: fbdev: cobalt_lcdfb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/cobalt_lcdfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/cobalt_lcdfb.c b/drivers/video/fbdev/cobalt_lcdfb.c index 5f8b6324d2e8..feeace079425 100644 --- a/drivers/video/fbdev/cobalt_lcdfb.c +++ b/drivers/video/fbdev/cobalt_lcdfb.c @@ -324,7 +324,7 @@ static int cobalt_lcdfb_probe(struct platform_device *dev) return 0; } -static int cobalt_lcdfb_remove(struct platform_device *dev) +static void cobalt_lcdfb_remove(struct platform_device *dev) { struct fb_info *info; @@ -333,13 +333,11 @@ static int cobalt_lcdfb_remove(struct platform_device *dev) unregister_framebuffer(info); framebuffer_release(info); } - - return 0; } static struct platform_driver cobalt_lcdfb_driver = { .probe = cobalt_lcdfb_probe, - .remove = cobalt_lcdfb_remove, + .remove_new = cobalt_lcdfb_remove, .driver = { .name = "cobalt-lcd", }, -- cgit From 33c890d022f91d7807cc9673f7017b480f64b2cf Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:49 +0100 Subject: fbdev: da8xx-fb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/da8xx-fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c index cd07e401b326..60cd1286370f 100644 --- a/drivers/video/fbdev/da8xx-fb.c +++ b/drivers/video/fbdev/da8xx-fb.c @@ -1064,7 +1064,7 @@ static void lcd_da8xx_cpufreq_deregister(struct da8xx_fb_par *par) } #endif -static int fb_remove(struct platform_device *dev) +static void fb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); struct da8xx_fb_par *par = info->par; @@ -1091,8 +1091,6 @@ static int fb_remove(struct platform_device *dev) pm_runtime_put_sync(&dev->dev); pm_runtime_disable(&dev->dev); framebuffer_release(info); - - return 0; } /* @@ -1657,7 +1655,7 @@ static SIMPLE_DEV_PM_OPS(fb_pm_ops, fb_suspend, fb_resume); static struct platform_driver da8xx_fb_driver = { .probe = fb_probe, - .remove = fb_remove, + .remove_new = fb_remove, .driver = { .name = DRIVER_NAME, .pm = &fb_pm_ops, -- cgit From 156ebfe4c87d1379fd599677d90056c911dc03f8 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:50 +0100 Subject: fbdev: efifb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/efifb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index a5779fb453a2..3d7be69ab593 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -621,15 +621,13 @@ err_release_mem: return err; } -static int efifb_remove(struct platform_device *pdev) +static void efifb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); /* efifb_destroy takes care of info cleanup */ unregister_framebuffer(info); sysfs_remove_groups(&pdev->dev.kobj, efifb_groups); - - return 0; } static struct platform_driver efifb_driver = { @@ -637,7 +635,7 @@ static struct platform_driver efifb_driver = { .name = "efi-framebuffer", }, .probe = efifb_probe, - .remove = efifb_remove, + .remove_new = efifb_remove, }; builtin_platform_driver(efifb_driver); -- cgit From 81431a9eaca14166f4dec21059f67cea81fac688 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:51 +0100 Subject: fbdev: ep93xx-fb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/ep93xx-fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/ep93xx-fb.c b/drivers/video/fbdev/ep93xx-fb.c index 305f1587bd89..94fe52928be2 100644 --- a/drivers/video/fbdev/ep93xx-fb.c +++ b/drivers/video/fbdev/ep93xx-fb.c @@ -573,7 +573,7 @@ failed_cmap: return err; } -static int ep93xxfb_remove(struct platform_device *pdev) +static void ep93xxfb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); struct ep93xx_fbi *fbi = info->par; @@ -587,13 +587,11 @@ static int ep93xxfb_remove(struct platform_device *pdev) fbi->mach_info->teardown(pdev); kfree(info); - - return 0; } static struct platform_driver ep93xxfb_driver = { .probe = ep93xxfb_probe, - .remove = ep93xxfb_remove, + .remove_new = ep93xxfb_remove, .driver = { .name = "ep93xx-fb", }, -- cgit From b917b0a9c6b92e0abb4e07a9568cd93df831b7ff Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:52 +0100 Subject: fbdev: ffb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/ffb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/ffb.c b/drivers/video/fbdev/ffb.c index 7cba3969a970..c6d3111dcbb0 100644 --- a/drivers/video/fbdev/ffb.c +++ b/drivers/video/fbdev/ffb.c @@ -1023,7 +1023,7 @@ out_err: return err; } -static int ffb_remove(struct platform_device *op) +static void ffb_remove(struct platform_device *op) { struct fb_info *info = dev_get_drvdata(&op->dev); struct ffb_par *par = info->par; @@ -1035,8 +1035,6 @@ static int ffb_remove(struct platform_device *op) of_iounmap(&op->resource[1], par->dac, sizeof(struct ffb_dac)); framebuffer_release(info); - - return 0; } static const struct of_device_id ffb_match[] = { @@ -1056,7 +1054,7 @@ static struct platform_driver ffb_driver = { .of_match_table = ffb_match, }, .probe = ffb_probe, - .remove = ffb_remove, + .remove_new = ffb_remove, }; static int __init ffb_init(void) -- cgit From 0dc08e875aca46813efad5a18c98749d2fb41935 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:53 +0100 Subject: fbdev: fsl-diu-fb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/fsl-diu-fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/fsl-diu-fb.c b/drivers/video/fbdev/fsl-diu-fb.c index e332017c6af6..730a07d23fa9 100644 --- a/drivers/video/fbdev/fsl-diu-fb.c +++ b/drivers/video/fbdev/fsl-diu-fb.c @@ -1823,7 +1823,7 @@ error: return ret; } -static int fsl_diu_remove(struct platform_device *pdev) +static void fsl_diu_remove(struct platform_device *pdev) { struct fsl_diu_data *data; int i; @@ -1837,8 +1837,6 @@ static int fsl_diu_remove(struct platform_device *pdev) uninstall_fb(&data->fsl_diu_info[i]); iounmap(data->diu_reg); - - return 0; } #ifndef MODULE @@ -1885,7 +1883,7 @@ static struct platform_driver fsl_diu_driver = { .of_match_table = fsl_diu_match, }, .probe = fsl_diu_probe, - .remove = fsl_diu_remove, + .remove_new = fsl_diu_remove, .suspend = fsl_diu_suspend, .resume = fsl_diu_resume, }; -- cgit From e16e7ea4a8e5023ce9a68d7762102b5a9ccb17dd Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:54 +0100 Subject: fbdev: gbefb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/gbefb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c index 000b4aa44241..3f141e21b7e0 100644 --- a/drivers/video/fbdev/gbefb.c +++ b/drivers/video/fbdev/gbefb.c @@ -1233,7 +1233,7 @@ out_release_framebuffer: return ret; } -static int gbefb_remove(struct platform_device* p_dev) +static void gbefb_remove(struct platform_device* p_dev) { struct fb_info *info = platform_get_drvdata(p_dev); struct gbefb_par *par = info->par; @@ -1243,13 +1243,11 @@ static int gbefb_remove(struct platform_device* p_dev) arch_phys_wc_del(par->wc_cookie); release_mem_region(GBE_BASE, sizeof(struct sgi_gbe)); framebuffer_release(info); - - return 0; } static struct platform_driver gbefb_driver = { .probe = gbefb_probe, - .remove = gbefb_remove, + .remove_new = gbefb_remove, .driver = { .name = "gbefb", .dev_groups = gbefb_groups, -- cgit From ecab1e9a54db8a2535d3ee7b25f78c3d02dfad19 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:55 +0100 Subject: fbdev: goldfishfb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/goldfishfb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c index 2b885cd046fe..6fa2108fd912 100644 --- a/drivers/video/fbdev/goldfishfb.c +++ b/drivers/video/fbdev/goldfishfb.c @@ -283,7 +283,7 @@ err_fb_alloc_failed: return ret; } -static int goldfish_fb_remove(struct platform_device *pdev) +static void goldfish_fb_remove(struct platform_device *pdev) { size_t framesize; struct goldfish_fb *fb = platform_get_drvdata(pdev); @@ -296,7 +296,6 @@ static int goldfish_fb_remove(struct platform_device *pdev) fb->fb.fix.smem_start); iounmap(fb->reg_base); kfree(fb); - return 0; } static const struct of_device_id goldfish_fb_of_match[] = { @@ -315,7 +314,7 @@ MODULE_DEVICE_TABLE(acpi, goldfish_fb_acpi_match); static struct platform_driver goldfish_fb_driver = { .probe = goldfish_fb_probe, - .remove = goldfish_fb_remove, + .remove_new = goldfish_fb_remove, .driver = { .name = "goldfish_fb", .of_match_table = goldfish_fb_of_match, -- cgit From 41aede214f2f68f69d42a802ca8aab5b1aa9ea66 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:56 +0100 Subject: fbdev: grvga: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/grvga.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/grvga.c b/drivers/video/fbdev/grvga.c index 24818b276241..9aa15be29ea9 100644 --- a/drivers/video/fbdev/grvga.c +++ b/drivers/video/fbdev/grvga.c @@ -504,7 +504,7 @@ free_fb: return retval; } -static int grvga_remove(struct platform_device *device) +static void grvga_remove(struct platform_device *device) { struct fb_info *info = dev_get_drvdata(&device->dev); struct grvga_par *par; @@ -524,8 +524,6 @@ static int grvga_remove(struct platform_device *device) framebuffer_release(info); } - - return 0; } static struct of_device_id svgactrl_of_match[] = { @@ -545,7 +543,7 @@ static struct platform_driver grvga_driver = { .of_match_table = svgactrl_of_match, }, .probe = grvga_probe, - .remove = grvga_remove, + .remove_new = grvga_remove, }; module_platform_driver(grvga_driver); -- cgit From 5be0ce71097d087060cc9e9a416f62fa74e5a9dd Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:57 +0100 Subject: fbdev: hecubafb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/hecubafb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/hecubafb.c b/drivers/video/fbdev/hecubafb.c index eb1eaadc1bbb..5a149458d3b4 100644 --- a/drivers/video/fbdev/hecubafb.c +++ b/drivers/video/fbdev/hecubafb.c @@ -279,7 +279,7 @@ err_videomem_alloc: return retval; } -static int hecubafb_remove(struct platform_device *dev) +static void hecubafb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); @@ -293,12 +293,11 @@ static int hecubafb_remove(struct platform_device *dev) module_put(par->board->owner); framebuffer_release(info); } - return 0; } static struct platform_driver hecubafb_driver = { .probe = hecubafb_probe, - .remove = hecubafb_remove, + .remove_new = hecubafb_remove, .driver = { .name = "hecubafb", }, -- cgit From f693b4de3546fa484b86437fb06ac307603aed3e Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:58 +0100 Subject: fbdev: hgafb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/hgafb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/hgafb.c b/drivers/video/fbdev/hgafb.c index bd3d07aa4f0e..20bdab738ab7 100644 --- a/drivers/video/fbdev/hgafb.c +++ b/drivers/video/fbdev/hgafb.c @@ -595,7 +595,7 @@ static int hgafb_probe(struct platform_device *pdev) return 0; } -static int hgafb_remove(struct platform_device *pdev) +static void hgafb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); @@ -614,13 +614,11 @@ static int hgafb_remove(struct platform_device *pdev) if (release_io_port) release_region(0x3bf, 1); - - return 0; } static struct platform_driver hgafb_driver = { .probe = hgafb_probe, - .remove = hgafb_remove, + .remove_new = hgafb_remove, .driver = { .name = "hgafb", }, -- cgit From a1bb53688630aff762e79c6e4d781f33283f82a7 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:53:59 +0100 Subject: fbdev: hitfb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/hitfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/hitfb.c b/drivers/video/fbdev/hitfb.c index bbb0f1d953cc..3033f5056976 100644 --- a/drivers/video/fbdev/hitfb.c +++ b/drivers/video/fbdev/hitfb.c @@ -415,15 +415,13 @@ err_fb: return ret; } -static int hitfb_remove(struct platform_device *dev) +static void hitfb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); unregister_framebuffer(info); fb_dealloc_cmap(&info->cmap); framebuffer_release(info); - - return 0; } static int hitfb_suspend(struct device *dev) @@ -460,7 +458,7 @@ static const struct dev_pm_ops hitfb_dev_pm_ops = { static struct platform_driver hitfb_driver = { .probe = hitfb_probe, - .remove = hitfb_remove, + .remove_new = hitfb_remove, .driver = { .name = "hitfb", .pm = &hitfb_dev_pm_ops, -- cgit From 909b7a3ea3989715ff20c191682c6a90eac3b4a4 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:00 +0100 Subject: fbdev: imxfb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/imxfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c index 51fde1b2a793..adf36690c342 100644 --- a/drivers/video/fbdev/imxfb.c +++ b/drivers/video/fbdev/imxfb.c @@ -1051,7 +1051,7 @@ failed_init: return ret; } -static int imxfb_remove(struct platform_device *pdev) +static void imxfb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); struct imxfb_info *fbi = info->par; @@ -1064,8 +1064,6 @@ static int imxfb_remove(struct platform_device *pdev) fbi->map_dma); kfree(info->pseudo_palette); framebuffer_release(info); - - return 0; } static int __maybe_unused imxfb_suspend(struct device *dev) @@ -1097,7 +1095,7 @@ static struct platform_driver imxfb_driver = { .pm = &imxfb_pm_ops, }, .probe = imxfb_probe, - .remove = imxfb_remove, + .remove_new = imxfb_remove, .id_table = imxfb_devtype, }; module_platform_driver(imxfb_driver); -- cgit From 3eafb6a37617eff4678723acb3400fe37e77f631 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:01 +0100 Subject: fbdev: leo: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/leo.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/leo.c b/drivers/video/fbdev/leo.c index 3eb0f3583f4f..3ffc0a725f89 100644 --- a/drivers/video/fbdev/leo.c +++ b/drivers/video/fbdev/leo.c @@ -637,7 +637,7 @@ out_err: return err; } -static int leo_remove(struct platform_device *op) +static void leo_remove(struct platform_device *op) { struct fb_info *info = dev_get_drvdata(&op->dev); struct leo_par *par = info->par; @@ -648,8 +648,6 @@ static int leo_remove(struct platform_device *op) leo_unmap_regs(op, info, par); framebuffer_release(info); - - return 0; } static const struct of_device_id leo_match[] = { @@ -666,7 +664,7 @@ static struct platform_driver leo_driver = { .of_match_table = leo_match, }, .probe = leo_probe, - .remove = leo_remove, + .remove_new = leo_remove, }; static int __init leo_init(void) -- cgit From 3a2ab02ddfacb04f92d47f2fe6e4aef4c95366e4 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:02 +0100 Subject: fbdev: mb862xx: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/mb862xx/mb862xxfbdrv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c index a236fc910148..b5c8fcab9940 100644 --- a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c +++ b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c @@ -784,7 +784,7 @@ fbrel: return ret; } -static int of_platform_mb862xx_remove(struct platform_device *ofdev) +static void of_platform_mb862xx_remove(struct platform_device *ofdev) { struct fb_info *fbi = dev_get_drvdata(&ofdev->dev); struct mb862xxfb_par *par = fbi->par; @@ -814,7 +814,6 @@ static int of_platform_mb862xx_remove(struct platform_device *ofdev) release_mem_region(par->res->start, res_size); framebuffer_release(fbi); - return 0; } /* @@ -838,7 +837,7 @@ static struct platform_driver of_platform_mb862xxfb_driver = { .of_match_table = of_platform_mb862xx_tbl, }, .probe = of_platform_mb862xx_probe, - .remove = of_platform_mb862xx_remove, + .remove_new = of_platform_mb862xx_remove, }; #endif -- cgit From d0513776c132e040b2a438864dd1a2a362326858 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:03 +0100 Subject: fbdev: metronomefb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/metronomefb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/metronomefb.c b/drivers/video/fbdev/metronomefb.c index 9fd4bb85d735..bbdbf463f0c8 100644 --- a/drivers/video/fbdev/metronomefb.c +++ b/drivers/video/fbdev/metronomefb.c @@ -744,7 +744,7 @@ err: return retval; } -static int metronomefb_remove(struct platform_device *dev) +static void metronomefb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); @@ -761,12 +761,11 @@ static int metronomefb_remove(struct platform_device *dev) dev_dbg(&dev->dev, "calling release\n"); framebuffer_release(info); } - return 0; } static struct platform_driver metronomefb_driver = { .probe = metronomefb_probe, - .remove = metronomefb_remove, + .remove_new = metronomefb_remove, .driver = { .name = "metronomefb", }, -- cgit From 419368fba704bf34c6d04a891b3989f47678911e Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:04 +0100 Subject: fbdev: mx3fb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/mx3fb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c index 76771e126d0a..63c186e0364a 100644 --- a/drivers/video/fbdev/mx3fb.c +++ b/drivers/video/fbdev/mx3fb.c @@ -1616,7 +1616,7 @@ eremap: return ret; } -static int mx3fb_remove(struct platform_device *dev) +static void mx3fb_remove(struct platform_device *dev) { struct mx3fb_data *mx3fb = platform_get_drvdata(dev); struct fb_info *fbi = mx3fb->fbi; @@ -1632,7 +1632,6 @@ static int mx3fb_remove(struct platform_device *dev) dmaengine_put(); iounmap(mx3fb->reg_base); - return 0; } static struct platform_driver mx3fb_driver = { @@ -1640,7 +1639,7 @@ static struct platform_driver mx3fb_driver = { .name = MX3FB_NAME, }, .probe = mx3fb_probe, - .remove = mx3fb_remove, + .remove_new = mx3fb_remove, .suspend = mx3fb_suspend, .resume = mx3fb_resume, }; -- cgit From d14e9328fef310b42c58688cb5c3caaace5c967e Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:05 +0100 Subject: fbdev: ocfb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/ocfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/ocfb.c b/drivers/video/fbdev/ocfb.c index da7e1457e58f..7ebe794583e1 100644 --- a/drivers/video/fbdev/ocfb.c +++ b/drivers/video/fbdev/ocfb.c @@ -370,7 +370,7 @@ err_dma_free: return ret; } -static int ocfb_remove(struct platform_device *pdev) +static void ocfb_remove(struct platform_device *pdev) { struct ocfb_dev *fbdev = platform_get_drvdata(pdev); @@ -383,8 +383,6 @@ static int ocfb_remove(struct platform_device *pdev) ocfb_writereg(fbdev, OCFB_CTRL, 0); platform_set_drvdata(pdev, NULL); - - return 0; } static const struct of_device_id ocfb_match[] = { @@ -395,7 +393,7 @@ MODULE_DEVICE_TABLE(of, ocfb_match); static struct platform_driver ocfb_driver = { .probe = ocfb_probe, - .remove = ocfb_remove, + .remove_new = ocfb_remove, .driver = { .name = "ocfb_fb", .of_match_table = ocfb_match, -- cgit From db031426eb4680137f023d75fdb3646664227335 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:06 +0100 Subject: fbdev: offb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/offb.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c index b97d251d894b..0065a77b6dbc 100644 --- a/drivers/video/fbdev/offb.c +++ b/drivers/video/fbdev/offb.c @@ -658,14 +658,12 @@ static void offb_init_nodriver(struct platform_device *parent, struct device_nod } } -static int offb_remove(struct platform_device *pdev) +static void offb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); if (info) unregister_framebuffer(info); - - return 0; } static int offb_probe_bootx_noscreen(struct platform_device *pdev) @@ -680,7 +678,7 @@ static struct platform_driver offb_driver_bootx_noscreen = { .name = "bootx-noscreen", }, .probe = offb_probe_bootx_noscreen, - .remove = offb_remove, + .remove_new = offb_remove, }; static int offb_probe_display(struct platform_device *pdev) @@ -702,7 +700,7 @@ static struct platform_driver offb_driver_display = { .of_match_table = offb_of_match_display, }, .probe = offb_probe_display, - .remove = offb_remove, + .remove_new = offb_remove, }; static int __init offb_init(void) -- cgit From dc6b77badc752e4965919f7b81ad9e3725ae0a64 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:07 +0100 Subject: fbdev: omapfb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/omap/omapfb_main.c | 6 ++---- drivers/video/fbdev/omap2/omapfb/dss/core.c | 6 ++---- drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/dss/dpi.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/dss/dss.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/dss/sdi.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/dss/venc.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 6 ++---- 11 files changed, 22 insertions(+), 36 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index 18736079843d..ad65554b33c3 100644 --- a/drivers/video/fbdev/omap/omapfb_main.c +++ b/drivers/video/fbdev/omap/omapfb_main.c @@ -1799,7 +1799,7 @@ void omapfb_register_panel(struct lcd_panel *panel) EXPORT_SYMBOL_GPL(omapfb_register_panel); /* Called when the device is being detached from the driver */ -static int omapfb_remove(struct platform_device *pdev) +static void omapfb_remove(struct platform_device *pdev) { struct omapfb_device *fbdev = platform_get_drvdata(pdev); enum omapfb_state saved_state = fbdev->state; @@ -1811,8 +1811,6 @@ static int omapfb_remove(struct platform_device *pdev) platform_device_unregister(&omapdss_device); fbdev->dssdev = NULL; - - return 0; } /* PM suspend */ @@ -1837,7 +1835,7 @@ static int omapfb_resume(struct platform_device *pdev) static struct platform_driver omapfb_driver = { .probe = omapfb_probe, - .remove = omapfb_remove, + .remove_new = omapfb_remove, .suspend = omapfb_suspend, .resume = omapfb_resume, .driver = { diff --git a/drivers/video/fbdev/omap2/omapfb/dss/core.c b/drivers/video/fbdev/omap2/omapfb/dss/core.c index 37858be8be83..5fbd8885bad8 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/core.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/core.c @@ -171,13 +171,11 @@ static int __init omap_dss_probe(struct platform_device *pdev) return 0; } -static int omap_dss_remove(struct platform_device *pdev) +static void omap_dss_remove(struct platform_device *pdev) { unregister_pm_notifier(&omap_dss_pm_notif_block); dss_uninitialize_debugfs(); - - return 0; } static void omap_dss_shutdown(struct platform_device *pdev) @@ -187,7 +185,7 @@ static void omap_dss_shutdown(struct platform_device *pdev) } static struct platform_driver omap_dss_driver = { - .remove = omap_dss_remove, + .remove_new = omap_dss_remove, .shutdown = omap_dss_shutdown, .driver = { .name = "omapdss", diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c index 92fb6b7e1f68..21fef9db90d2 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c @@ -4017,10 +4017,9 @@ static int dispc_probe(struct platform_device *pdev) return component_add(&pdev->dev, &dispc_component_ops); } -static int dispc_remove(struct platform_device *pdev) +static void dispc_remove(struct platform_device *pdev) { component_del(&pdev->dev, &dispc_component_ops); - return 0; } static int dispc_runtime_suspend(struct device *dev) @@ -4073,7 +4072,7 @@ static const struct of_device_id dispc_of_match[] = { static struct platform_driver omap_dispchw_driver = { .probe = dispc_probe, - .remove = dispc_remove, + .remove_new = dispc_remove, .driver = { .name = "omapdss_dispc", .pm = &dispc_pm_ops, diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c index 99ce6e955a46..7c1b7d89389a 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c @@ -810,15 +810,14 @@ static int dpi_probe(struct platform_device *pdev) return component_add(&pdev->dev, &dpi_component_ops); } -static int dpi_remove(struct platform_device *pdev) +static void dpi_remove(struct platform_device *pdev) { component_del(&pdev->dev, &dpi_component_ops); - return 0; } static struct platform_driver omap_dpi_driver = { .probe = dpi_probe, - .remove = dpi_remove, + .remove_new = dpi_remove, .driver = { .name = "omapdss_dpi", .suppress_bind_attrs = true, diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c index 7cddb7b8ae34..b7eb17a16ec4 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c @@ -5495,10 +5495,9 @@ static int dsi_probe(struct platform_device *pdev) return component_add(&pdev->dev, &dsi_component_ops); } -static int dsi_remove(struct platform_device *pdev) +static void dsi_remove(struct platform_device *pdev) { component_del(&pdev->dev, &dsi_component_ops); - return 0; } static int dsi_runtime_suspend(struct device *dev) @@ -5565,7 +5564,7 @@ static const struct of_device_id dsi_of_match[] = { static struct platform_driver omap_dsihw_driver = { .probe = dsi_probe, - .remove = dsi_remove, + .remove_new = dsi_remove, .driver = { .name = "omapdss_dsi", .pm = &dsi_pm_ops, diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c index 335e0af4eec1..d814e4baa4b3 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c @@ -1224,10 +1224,9 @@ static int dss_probe(struct platform_device *pdev) return 0; } -static int dss_remove(struct platform_device *pdev) +static void dss_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &dss_component_ops); - return 0; } static int dss_runtime_suspend(struct device *dev) @@ -1279,7 +1278,7 @@ MODULE_DEVICE_TABLE(of, dss_of_match); static struct platform_driver omap_dsshw_driver = { .probe = dss_probe, - .remove = dss_remove, + .remove_new = dss_remove, .driver = { .name = "omapdss_dss", .pm = &dss_pm_ops, diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c index 0f39612e002e..f05b4e35a842 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c @@ -756,10 +756,9 @@ static int hdmi4_probe(struct platform_device *pdev) return component_add(&pdev->dev, &hdmi4_component_ops); } -static int hdmi4_remove(struct platform_device *pdev) +static void hdmi4_remove(struct platform_device *pdev) { component_del(&pdev->dev, &hdmi4_component_ops); - return 0; } static int hdmi_runtime_suspend(struct device *dev) @@ -792,7 +791,7 @@ static const struct of_device_id hdmi_of_match[] = { static struct platform_driver omapdss_hdmihw_driver = { .probe = hdmi4_probe, - .remove = hdmi4_remove, + .remove_new = hdmi4_remove, .driver = { .name = "omapdss_hdmi", .pm = &hdmi_pm_ops, diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c index bfccc2cb917a..03292945b1d4 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c @@ -797,10 +797,9 @@ static int hdmi5_probe(struct platform_device *pdev) return component_add(&pdev->dev, &hdmi5_component_ops); } -static int hdmi5_remove(struct platform_device *pdev) +static void hdmi5_remove(struct platform_device *pdev) { component_del(&pdev->dev, &hdmi5_component_ops); - return 0; } static int hdmi_runtime_suspend(struct device *dev) @@ -834,7 +833,7 @@ static const struct of_device_id hdmi_of_match[] = { static struct platform_driver omapdss_hdmihw_driver = { .probe = hdmi5_probe, - .remove = hdmi5_remove, + .remove_new = hdmi5_remove, .driver = { .name = "omapdss_hdmi5", .pm = &hdmi_pm_ops, diff --git a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c index 002f07f5480f..d527931b2b16 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c @@ -375,15 +375,14 @@ static int sdi_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sdi_component_ops); } -static int sdi_remove(struct platform_device *pdev) +static void sdi_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sdi_component_ops); - return 0; } static struct platform_driver omap_sdi_driver = { .probe = sdi_probe, - .remove = sdi_remove, + .remove_new = sdi_remove, .driver = { .name = "omapdss_sdi", .suppress_bind_attrs = true, diff --git a/drivers/video/fbdev/omap2/omapfb/dss/venc.c b/drivers/video/fbdev/omap2/omapfb/dss/venc.c index 78a7309d25dd..c9d40e28a06f 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/venc.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/venc.c @@ -880,10 +880,9 @@ static int venc_probe(struct platform_device *pdev) return component_add(&pdev->dev, &venc_component_ops); } -static int venc_remove(struct platform_device *pdev) +static void venc_remove(struct platform_device *pdev) { component_del(&pdev->dev, &venc_component_ops); - return 0; } static int venc_runtime_suspend(struct device *dev) @@ -922,7 +921,7 @@ static const struct of_device_id venc_of_match[] = { static struct platform_driver omap_venchw_driver = { .probe = venc_probe, - .remove = venc_remove, + .remove_new = venc_remove, .driver = { .name = "omapdss_venc", .pm = &venc_pm_ops, diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c index 5ccddcfce722..c0538069eb48 100644 --- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c +++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c @@ -2599,7 +2599,7 @@ err0: return r; } -static int omapfb_remove(struct platform_device *pdev) +static void omapfb_remove(struct platform_device *pdev) { struct omapfb2_device *fbdev = platform_get_drvdata(pdev); @@ -2610,13 +2610,11 @@ static int omapfb_remove(struct platform_device *pdev) omapfb_free_resources(fbdev); omapdss_compat_uninit(); - - return 0; } static struct platform_driver omapfb_driver = { .probe = omapfb_probe, - .remove = omapfb_remove, + .remove_new = omapfb_remove, .driver = { .name = "omapfb", }, -- cgit From 4d7960389f9e91dc7d09734f79346850f4fd11d9 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:08 +0100 Subject: fbdev: p9100: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/p9100.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/p9100.c b/drivers/video/fbdev/p9100.c index 4e88a0a195ad..3e44f9516318 100644 --- a/drivers/video/fbdev/p9100.c +++ b/drivers/video/fbdev/p9100.c @@ -327,7 +327,7 @@ out_err: return err; } -static int p9100_remove(struct platform_device *op) +static void p9100_remove(struct platform_device *op) { struct fb_info *info = dev_get_drvdata(&op->dev); struct p9100_par *par = info->par; @@ -339,8 +339,6 @@ static int p9100_remove(struct platform_device *op) of_iounmap(&op->resource[2], info->screen_base, info->fix.smem_len); framebuffer_release(info); - - return 0; } static const struct of_device_id p9100_match[] = { @@ -357,7 +355,7 @@ static struct platform_driver p9100_driver = { .of_match_table = p9100_match, }, .probe = p9100_probe, - .remove = p9100_remove, + .remove_new = p9100_remove, }; static int __init p9100_init(void) -- cgit From cc6a0d407c4a8c8ce9aa971124592b3c805cf6f6 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:09 +0100 Subject: fbdev: platinumfb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/platinumfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/platinumfb.c b/drivers/video/fbdev/platinumfb.c index 5b9e26ea6449..82f019f0a0d6 100644 --- a/drivers/video/fbdev/platinumfb.c +++ b/drivers/video/fbdev/platinumfb.c @@ -636,7 +636,7 @@ static int platinumfb_probe(struct platform_device* odev) return rc; } -static int platinumfb_remove(struct platform_device* odev) +static void platinumfb_remove(struct platform_device* odev) { struct fb_info *info = dev_get_drvdata(&odev->dev); struct fb_info_platinum *pinfo = info->par; @@ -654,8 +654,6 @@ static int platinumfb_remove(struct platform_device* odev) release_mem_region(pinfo->cmap_regs_phys, 0x1000); framebuffer_release(info); - - return 0; } static struct of_device_id platinumfb_match[] = @@ -673,7 +671,7 @@ static struct platform_driver platinum_driver = .of_match_table = platinumfb_match, }, .probe = platinumfb_probe, - .remove = platinumfb_remove, + .remove_new = platinumfb_remove, }; static int __init platinumfb_init(void) -- cgit From bcfb6d43bb08babd207a93bce99d86c25febd51d Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:10 +0100 Subject: fbdev: pxa168fb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/pxa168fb.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/pxa168fb.c b/drivers/video/fbdev/pxa168fb.c index d5d0bbd39213..79f338463092 100644 --- a/drivers/video/fbdev/pxa168fb.c +++ b/drivers/video/fbdev/pxa168fb.c @@ -765,14 +765,14 @@ failed_free_info: return ret; } -static int pxa168fb_remove(struct platform_device *pdev) +static void pxa168fb_remove(struct platform_device *pdev) { struct pxa168fb_info *fbi = platform_get_drvdata(pdev); struct fb_info *info; unsigned int data; if (!fbi) - return 0; + return; /* disable DMA transfer */ data = readl(fbi->reg_base + LCD_SPU_DMA_CTRL0); @@ -794,8 +794,6 @@ static int pxa168fb_remove(struct platform_device *pdev) clk_disable_unprepare(fbi->clk); framebuffer_release(info); - - return 0; } static struct platform_driver pxa168fb_driver = { @@ -803,7 +801,7 @@ static struct platform_driver pxa168fb_driver = { .name = "pxa168-fb", }, .probe = pxa168fb_probe, - .remove = pxa168fb_remove, + .remove_new = pxa168fb_remove, }; module_platform_driver(pxa168fb_driver); -- cgit From 2872c2913abf2d51c2d333477933801e14cc284b Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:11 +0100 Subject: fbdev: pxa3xx-gcu: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/pxa3xx-gcu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c index d16729215423..43c80316d84b 100644 --- a/drivers/video/fbdev/pxa3xx-gcu.c +++ b/drivers/video/fbdev/pxa3xx-gcu.c @@ -675,7 +675,7 @@ err_free_dma: return ret; } -static int pxa3xx_gcu_remove(struct platform_device *pdev) +static void pxa3xx_gcu_remove(struct platform_device *pdev) { struct pxa3xx_gcu_priv *priv = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; @@ -685,8 +685,6 @@ static int pxa3xx_gcu_remove(struct platform_device *pdev) dma_free_coherent(dev, SHARED_SIZE, priv->shared, priv->shared_phys); clk_disable_unprepare(priv->clk); pxa3xx_gcu_free_buffers(dev, priv); - - return 0; } #ifdef CONFIG_OF @@ -699,7 +697,7 @@ MODULE_DEVICE_TABLE(of, pxa3xx_gcu_of_match); static struct platform_driver pxa3xx_gcu_driver = { .probe = pxa3xx_gcu_probe, - .remove = pxa3xx_gcu_remove, + .remove_new = pxa3xx_gcu_remove, .driver = { .name = DRV_NAME, .of_match_table = of_match_ptr(pxa3xx_gcu_of_match), -- cgit From eb703b6089bdeee974a02894a001de3df804f772 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:12 +0100 Subject: fbdev: pxafb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/pxafb.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c index c46ed78298ae..2a8b1dea3a67 100644 --- a/drivers/video/fbdev/pxafb.c +++ b/drivers/video/fbdev/pxafb.c @@ -2396,13 +2396,13 @@ failed: return ret; } -static int pxafb_remove(struct platform_device *dev) +static void pxafb_remove(struct platform_device *dev) { struct pxafb_info *fbi = platform_get_drvdata(dev); struct fb_info *info; if (!fbi) - return 0; + return; info = &fbi->fb; @@ -2418,8 +2418,6 @@ static int pxafb_remove(struct platform_device *dev) dma_free_coherent(&dev->dev, fbi->dma_buff_size, fbi->dma_buff, fbi->dma_buff_phys); - - return 0; } static const struct of_device_id pxafb_of_dev_id[] = { @@ -2432,7 +2430,7 @@ MODULE_DEVICE_TABLE(of, pxafb_of_dev_id); static struct platform_driver pxafb_driver = { .probe = pxafb_probe, - .remove = pxafb_remove, + .remove_new = pxafb_remove, .driver = { .name = "pxa2xx-fb", .of_match_table = pxafb_of_dev_id, -- cgit From 77da73b32ceae6bb240fb57be6858042c76f9362 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:13 +0100 Subject: fbdev: s1d13xxxfb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/s1d13xxxfb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/s1d13xxxfb.c b/drivers/video/fbdev/s1d13xxxfb.c index d1b5f965bc96..8f2edccdba46 100644 --- a/drivers/video/fbdev/s1d13xxxfb.c +++ b/drivers/video/fbdev/s1d13xxxfb.c @@ -748,13 +748,12 @@ static void __s1d13xxxfb_remove(struct platform_device *pdev) resource_size(&pdev->resource[1])); } -static int s1d13xxxfb_remove(struct platform_device *pdev) +static void s1d13xxxfb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); unregister_framebuffer(info); __s1d13xxxfb_remove(pdev); - return 0; } static int s1d13xxxfb_probe(struct platform_device *pdev) @@ -995,7 +994,7 @@ static int s1d13xxxfb_resume(struct platform_device *dev) static struct platform_driver s1d13xxxfb_driver = { .probe = s1d13xxxfb_probe, - .remove = s1d13xxxfb_remove, + .remove_new = s1d13xxxfb_remove, #ifdef CONFIG_PM .suspend = s1d13xxxfb_suspend, .resume = s1d13xxxfb_resume, -- cgit From f2f34fb9f94f79f7d7bb12410d2e0b7f3b867a54 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:14 +0100 Subject: fbdev: s3c-fb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/s3c-fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c index 3abbc5737c3b..1ce707e4cfd0 100644 --- a/drivers/video/fbdev/s3c-fb.c +++ b/drivers/video/fbdev/s3c-fb.c @@ -1507,7 +1507,7 @@ err_bus_clk: * Shutdown and then release all the resources that the driver allocated * on initialisation. */ -static int s3c_fb_remove(struct platform_device *pdev) +static void s3c_fb_remove(struct platform_device *pdev) { struct s3c_fb *sfb = platform_get_drvdata(pdev); int win; @@ -1525,8 +1525,6 @@ static int s3c_fb_remove(struct platform_device *pdev) pm_runtime_put_sync(sfb->dev); pm_runtime_disable(sfb->dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1794,7 +1792,7 @@ static const struct dev_pm_ops s3cfb_pm_ops = { static struct platform_driver s3c_fb_driver = { .probe = s3c_fb_probe, - .remove = s3c_fb_remove, + .remove_new = s3c_fb_remove, .id_table = s3c_fb_driver_ids, .driver = { .name = "s3c-fb", -- cgit From 03dfa8d2be6f16c087fe871f043a99857cb38d80 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:15 +0100 Subject: fbdev: sh7760fb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/sh7760fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/sh7760fb.c b/drivers/video/fbdev/sh7760fb.c index 5978a8921232..768011bdb430 100644 --- a/drivers/video/fbdev/sh7760fb.c +++ b/drivers/video/fbdev/sh7760fb.c @@ -554,7 +554,7 @@ out_fb: return ret; } -static int sh7760fb_remove(struct platform_device *dev) +static void sh7760fb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); struct sh7760fb_par *par = info->par; @@ -568,8 +568,6 @@ static int sh7760fb_remove(struct platform_device *dev) iounmap(par->base); release_mem_region(par->ioarea->start, resource_size(par->ioarea)); framebuffer_release(info); - - return 0; } static struct platform_driver sh7760_lcdc_driver = { @@ -577,7 +575,7 @@ static struct platform_driver sh7760_lcdc_driver = { .name = "sh7760-lcdc", }, .probe = sh7760fb_probe, - .remove = sh7760fb_remove, + .remove_new = sh7760fb_remove, }; module_platform_driver(sh7760_lcdc_driver); -- cgit From 068240885346a4f484237e24dc1f75530a58c370 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:16 +0100 Subject: fbdev: sh_mobile_lcdcfb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven Signed-off-by: Helge Deller --- drivers/video/fbdev/sh_mobile_lcdcfb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index ad9323ed8e2e..093f035d1246 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -2249,7 +2249,7 @@ static const struct fb_videomode default_720p = { .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT, }; -static int sh_mobile_lcdc_remove(struct platform_device *pdev) +static void sh_mobile_lcdc_remove(struct platform_device *pdev) { struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev); unsigned int i; @@ -2305,7 +2305,6 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) if (priv->irq) free_irq(priv->irq, priv); kfree(priv); - return 0; } static int sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch) @@ -2656,7 +2655,7 @@ static struct platform_driver sh_mobile_lcdc_driver = { .pm = &sh_mobile_lcdc_dev_pm_ops, }, .probe = sh_mobile_lcdc_probe, - .remove = sh_mobile_lcdc_remove, + .remove_new = sh_mobile_lcdc_remove, }; module_platform_driver(sh_mobile_lcdc_driver); -- cgit From 4ba34066a29bd9db89525ed5c18d1838658402eb Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:17 +0100 Subject: fbdev: simplefb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/simplefb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c index 10d71879d340..e4a13871bca6 100644 --- a/drivers/video/fbdev/simplefb.c +++ b/drivers/video/fbdev/simplefb.c @@ -538,14 +538,12 @@ error_release_mem_region: return ret; } -static int simplefb_remove(struct platform_device *pdev) +static void simplefb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); /* simplefb_destroy takes care of info cleanup */ unregister_framebuffer(info); - - return 0; } static const struct of_device_id simplefb_of_match[] = { @@ -560,7 +558,7 @@ static struct platform_driver simplefb_driver = { .of_match_table = simplefb_of_match, }, .probe = simplefb_probe, - .remove = simplefb_remove, + .remove_new = simplefb_remove, }; module_platform_driver(simplefb_driver); -- cgit From 7b49f61a7235813045c6adb34fdc5b5a0b7c2862 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:18 +0100 Subject: fbdev: sm501fb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/sm501fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index 1f3cbe723def..e0d29be1565b 100644 --- a/drivers/video/fbdev/sm501fb.c +++ b/drivers/video/fbdev/sm501fb.c @@ -2045,7 +2045,7 @@ err_alloc: /* * Cleanup */ -static int sm501fb_remove(struct platform_device *pdev) +static void sm501fb_remove(struct platform_device *pdev) { struct sm501fb_info *info = platform_get_drvdata(pdev); struct fb_info *fbinfo_crt = info->fb[0]; @@ -2064,8 +2064,6 @@ static int sm501fb_remove(struct platform_device *pdev) framebuffer_release(fbinfo_pnl); framebuffer_release(fbinfo_crt); - - return 0; } #ifdef CONFIG_PM @@ -2209,7 +2207,7 @@ static int sm501fb_resume(struct platform_device *pdev) static struct platform_driver sm501fb_driver = { .probe = sm501fb_probe, - .remove = sm501fb_remove, + .remove_new = sm501fb_remove, .suspend = sm501fb_suspend, .resume = sm501fb_resume, .driver = { -- cgit From 1fd99273942058f529b7b2821ada51e0d94aac23 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:19 +0100 Subject: fbdev: tcx: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/tcx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/tcx.c b/drivers/video/fbdev/tcx.c index f2eaf6e7fff6..fc3ac2301b45 100644 --- a/drivers/video/fbdev/tcx.c +++ b/drivers/video/fbdev/tcx.c @@ -486,7 +486,7 @@ out_err: return err; } -static int tcx_remove(struct platform_device *op) +static void tcx_remove(struct platform_device *op) { struct fb_info *info = dev_get_drvdata(&op->dev); struct tcx_par *par = info->par; @@ -497,8 +497,6 @@ static int tcx_remove(struct platform_device *op) tcx_unmap_regs(op, info, par); framebuffer_release(info); - - return 0; } static const struct of_device_id tcx_match[] = { @@ -515,7 +513,7 @@ static struct platform_driver tcx_driver = { .of_match_table = tcx_match, }, .probe = tcx_probe, - .remove = tcx_remove, + .remove_new = tcx_remove, }; static int __init tcx_init(void) -- cgit From 94bada58284c93a38105637bbab0513f9caa005d Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:20 +0100 Subject: fbdev: uvesafb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/uvesafb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c index f09f483c219b..78d85dae8ec8 100644 --- a/drivers/video/fbdev/uvesafb.c +++ b/drivers/video/fbdev/uvesafb.c @@ -1774,7 +1774,7 @@ out: return err; } -static int uvesafb_remove(struct platform_device *dev) +static void uvesafb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); struct uvesafb_par *par = info->par; @@ -1793,13 +1793,11 @@ static int uvesafb_remove(struct platform_device *dev) kfree(par->vbe_state_saved); framebuffer_release(info); - - return 0; } static struct platform_driver uvesafb_driver = { .probe = uvesafb_probe, - .remove = uvesafb_remove, + .remove_new = uvesafb_remove, .driver = { .name = "uvesafb", }, -- cgit From f3db09aae19846f92dcf4c7c238a0ea6f9560617 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:21 +0100 Subject: fbdev: vesafb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/vesafb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/vesafb.c b/drivers/video/fbdev/vesafb.c index 3f8bdfcf51f0..7451c607dc50 100644 --- a/drivers/video/fbdev/vesafb.c +++ b/drivers/video/fbdev/vesafb.c @@ -485,7 +485,7 @@ err_release_region: return err; } -static int vesafb_remove(struct platform_device *pdev) +static void vesafb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); @@ -494,8 +494,6 @@ static int vesafb_remove(struct platform_device *pdev) /* vesafb_destroy takes care of info cleanup */ unregister_framebuffer(info); - - return 0; } static struct platform_driver vesafb_driver = { @@ -503,7 +501,7 @@ static struct platform_driver vesafb_driver = { .name = "vesa-framebuffer", }, .probe = vesafb_probe, - .remove = vesafb_remove, + .remove_new = vesafb_remove, }; module_platform_driver(vesafb_driver); -- cgit From 24f677094e325dd669b8f60b75779e7ef8263503 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:22 +0100 Subject: fbdev: vfb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/vfb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/vfb.c b/drivers/video/fbdev/vfb.c index 95d3c59867d0..1a2514d564fc 100644 --- a/drivers/video/fbdev/vfb.c +++ b/drivers/video/fbdev/vfb.c @@ -479,7 +479,7 @@ err: return retval; } -static int vfb_remove(struct platform_device *dev) +static void vfb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); @@ -489,12 +489,11 @@ static int vfb_remove(struct platform_device *dev) fb_dealloc_cmap(&info->cmap); framebuffer_release(info); } - return 0; } static struct platform_driver vfb_driver = { .probe = vfb_probe, - .remove = vfb_remove, + .remove_new = vfb_remove, .driver = { .name = "vfb", }, -- cgit From 4a5ef62ce73b3c73ad3f844052b37cbabd9e2357 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:23 +0100 Subject: fbdev: vga16fb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/vga16fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/vga16fb.c b/drivers/video/fbdev/vga16fb.c index 1a8ffdb2be26..34d00347ad58 100644 --- a/drivers/video/fbdev/vga16fb.c +++ b/drivers/video/fbdev/vga16fb.c @@ -1401,14 +1401,12 @@ static int vga16fb_probe(struct platform_device *dev) return ret; } -static int vga16fb_remove(struct platform_device *dev) +static void vga16fb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); if (info) unregister_framebuffer(info); - - return 0; } static const struct platform_device_id vga16fb_driver_id_table[] = { @@ -1420,7 +1418,7 @@ MODULE_DEVICE_TABLE(platform, vga16fb_driver_id_table); static struct platform_driver vga16fb_driver = { .probe = vga16fb_probe, - .remove = vga16fb_remove, + .remove_new = vga16fb_remove, .driver = { .name = "vga16fb", }, -- cgit From 87b1e9a57445e4ee38cf1c03c203c82d5dda6aa3 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:24 +0100 Subject: fbdev: via: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/via/via-gpio.c | 5 ++--- drivers/video/fbdev/via/via_i2c.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/via/via-gpio.c b/drivers/video/fbdev/via/via-gpio.c index febb2aadd822..f1b670397c02 100644 --- a/drivers/video/fbdev/via/via-gpio.c +++ b/drivers/video/fbdev/via/via-gpio.c @@ -262,7 +262,7 @@ static int viafb_gpio_probe(struct platform_device *platdev) } -static int viafb_gpio_remove(struct platform_device *platdev) +static void viafb_gpio_remove(struct platform_device *platdev) { unsigned long flags; int i; @@ -285,7 +285,6 @@ static int viafb_gpio_remove(struct platform_device *platdev) viafb_gpio_disable(viafb_gpio_config.active_gpios[i]); viafb_gpio_config.gpio_chip.ngpio = 0; spin_unlock_irqrestore(&viafb_gpio_config.vdev->reg_lock, flags); - return 0; } static struct platform_driver via_gpio_driver = { @@ -293,7 +292,7 @@ static struct platform_driver via_gpio_driver = { .name = "viafb-gpio", }, .probe = viafb_gpio_probe, - .remove = viafb_gpio_remove, + .remove_new = viafb_gpio_remove, }; int viafb_gpio_init(void) diff --git a/drivers/video/fbdev/via/via_i2c.c b/drivers/video/fbdev/via/via_i2c.c index c7e63ab47c39..c35e530e0ec9 100644 --- a/drivers/video/fbdev/via/via_i2c.c +++ b/drivers/video/fbdev/via/via_i2c.c @@ -246,7 +246,7 @@ static int viafb_i2c_probe(struct platform_device *platdev) return 0; } -static int viafb_i2c_remove(struct platform_device *platdev) +static void viafb_i2c_remove(struct platform_device *platdev) { int i; @@ -259,7 +259,6 @@ static int viafb_i2c_remove(struct platform_device *platdev) if (i2c_stuff->is_active) i2c_del_adapter(&i2c_stuff->adapter); } - return 0; } static struct platform_driver via_i2c_driver = { @@ -267,7 +266,7 @@ static struct platform_driver via_i2c_driver = { .name = "viafb-i2c", }, .probe = viafb_i2c_probe, - .remove = viafb_i2c_remove, + .remove_new = viafb_i2c_remove, }; int viafb_i2c_init(void) -- cgit From 3ab20cdc752d82939859a2aabe76ffd3fa5ece6f Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:25 +0100 Subject: fbdev: vt8500lcdfb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/vt8500lcdfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/vt8500lcdfb.c b/drivers/video/fbdev/vt8500lcdfb.c index c61476247ba8..31d4e85b220c 100644 --- a/drivers/video/fbdev/vt8500lcdfb.c +++ b/drivers/video/fbdev/vt8500lcdfb.c @@ -439,7 +439,7 @@ failed_free_res: return ret; } -static int vt8500lcd_remove(struct platform_device *pdev) +static void vt8500lcd_remove(struct platform_device *pdev) { struct vt8500lcd_info *fbi = platform_get_drvdata(pdev); struct resource *res; @@ -462,8 +462,6 @@ static int vt8500lcd_remove(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); release_mem_region(res->start, resource_size(res)); - - return 0; } static const struct of_device_id via_dt_ids[] = { @@ -473,7 +471,7 @@ static const struct of_device_id via_dt_ids[] = { static struct platform_driver vt8500lcd_driver = { .probe = vt8500lcd_probe, - .remove = vt8500lcd_remove, + .remove_new = vt8500lcd_remove, .driver = { .name = "vt8500-lcd", .of_match_table = of_match_ptr(via_dt_ids), -- cgit From 024a3cafa5c965fd121948db5023e867cdaf73c9 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:26 +0100 Subject: fbdev: wm8505fb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/wm8505fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/wm8505fb.c b/drivers/video/fbdev/wm8505fb.c index 96a6f7623e19..de84d47dcbcc 100644 --- a/drivers/video/fbdev/wm8505fb.c +++ b/drivers/video/fbdev/wm8505fb.c @@ -372,7 +372,7 @@ static int wm8505fb_probe(struct platform_device *pdev) return 0; } -static int wm8505fb_remove(struct platform_device *pdev) +static void wm8505fb_remove(struct platform_device *pdev) { struct wm8505fb_info *fbi = platform_get_drvdata(pdev); @@ -382,8 +382,6 @@ static int wm8505fb_remove(struct platform_device *pdev) if (fbi->fb.cmap.len) fb_dealloc_cmap(&fbi->fb.cmap); - - return 0; } static const struct of_device_id wmt_dt_ids[] = { @@ -393,7 +391,7 @@ static const struct of_device_id wmt_dt_ids[] = { static struct platform_driver wm8505fb_driver = { .probe = wm8505fb_probe, - .remove = wm8505fb_remove, + .remove_new = wm8505fb_remove, .driver = { .name = DRIVER_NAME, .of_match_table = wmt_dt_ids, -- cgit From 89c4bbd457af5e18026e45bedd87f6f097edc83a Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:27 +0100 Subject: fbdev: wmt_ge_rops: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/wmt_ge_rops.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/wmt_ge_rops.c b/drivers/video/fbdev/wmt_ge_rops.c index 42255d27a1db..6196b9a6c44d 100644 --- a/drivers/video/fbdev/wmt_ge_rops.c +++ b/drivers/video/fbdev/wmt_ge_rops.c @@ -145,10 +145,9 @@ static int wmt_ge_rops_probe(struct platform_device *pdev) return 0; } -static int wmt_ge_rops_remove(struct platform_device *pdev) +static void wmt_ge_rops_remove(struct platform_device *pdev) { iounmap(regbase); - return 0; } static const struct of_device_id wmt_dt_ids[] = { @@ -158,7 +157,7 @@ static const struct of_device_id wmt_dt_ids[] = { static struct platform_driver wmt_ge_rops_driver = { .probe = wmt_ge_rops_probe, - .remove = wmt_ge_rops_remove, + .remove_new = wmt_ge_rops_remove, .driver = { .name = "wmt_ge_rops", .of_match_table = wmt_dt_ids, -- cgit From 0ddc95b59f05c280520fc3f23366293bc653d92d Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:28 +0100 Subject: fbdev: xilinxfb: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller --- drivers/video/fbdev/xilinxfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/xilinxfb.c b/drivers/video/fbdev/xilinxfb.c index 7911354827dc..2aa3a528277f 100644 --- a/drivers/video/fbdev/xilinxfb.c +++ b/drivers/video/fbdev/xilinxfb.c @@ -474,11 +474,9 @@ static int xilinxfb_of_probe(struct platform_device *pdev) return xilinxfb_assign(pdev, drvdata, &pdata); } -static int xilinxfb_of_remove(struct platform_device *op) +static void xilinxfb_of_remove(struct platform_device *op) { xilinxfb_release(&op->dev); - - return 0; } /* Match table for of_platform binding */ @@ -494,7 +492,7 @@ MODULE_DEVICE_TABLE(of, xilinxfb_of_match); static struct platform_driver xilinxfb_of_driver = { .probe = xilinxfb_of_probe, - .remove = xilinxfb_of_remove, + .remove_new = xilinxfb_of_remove, .driver = { .name = DRIVER_NAME, .of_match_table = xilinxfb_of_match, -- cgit From b3a7a9ab65ae2f2626c7222fb79cdd433f8c5252 Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Thu, 13 Apr 2023 21:33:17 +0200 Subject: fbdev: mmp: Fix deferred clk handling in mmphw_probe() When dev_err_probe() is called, 'ret' holds the value of the previous successful devm_request_irq() call. 'ret' should be assigned with a meaningful value before being used in dev_err_probe(). While at it, use and return "PTR_ERR(ctrl->clk)" instead of a hard-coded "-ENOENT" so that -EPROBE_DEFER is handled and propagated correctly. Fixes: 81b63420564d ("fbdev: mmp: Make use of the helper function dev_err_probe()") Signed-off-by: Christophe JAILLET Signed-off-by: Helge Deller --- drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c index a9df8ee79810..51fbf02a0343 100644 --- a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c +++ b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c @@ -514,9 +514,9 @@ static int mmphw_probe(struct platform_device *pdev) /* get clock */ ctrl->clk = devm_clk_get(ctrl->dev, mi->clk_name); if (IS_ERR(ctrl->clk)) { + ret = PTR_ERR(ctrl->clk); dev_err_probe(ctrl->dev, ret, "unable to get clk %s\n", mi->clk_name); - ret = -ENOENT; goto failed; } clk_prepare_enable(ctrl->clk); -- cgit From 55caa9a7aca0e7685ebb9f5082156e89cae36c4a Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 24 Apr 2023 10:58:23 +0200 Subject: fbdev: 68328fb: Init owner field of struct fb_ops Initialize the owner field of struct fb_ops. Required to prevent module unloading while the driver is in use. Signed-off-by: Thomas Zimmermann Signed-off-by: Helge Deller --- drivers/video/fbdev/68328fb.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/68328fb.c b/drivers/video/fbdev/68328fb.c index 41df61b37a18..3ccf46f8ffd0 100644 --- a/drivers/video/fbdev/68328fb.c +++ b/drivers/video/fbdev/68328fb.c @@ -94,6 +94,7 @@ static int mc68x328fb_pan_display(struct fb_var_screeninfo *var, static int mc68x328fb_mmap(struct fb_info *info, struct vm_area_struct *vma); static const struct fb_ops mc68x328fb_ops = { + .owner = THIS_MODULE, .fb_check_var = mc68x328fb_check_var, .fb_set_par = mc68x328fb_set_par, .fb_setcolreg = mc68x328fb_setcolreg, -- cgit From 25ec15abb06194963157fe42d41368b19a0d0d74 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 24 Apr 2023 10:58:24 +0200 Subject: fbdev: ps3fb: Init owner field of struct fb_ops Initialize the owner field of struct fb_ops. Required to prevent module unloading while the driver is in use. Signed-off-by: Thomas Zimmermann Signed-off-by: Helge Deller --- drivers/video/fbdev/ps3fb.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/ps3fb.c b/drivers/video/fbdev/ps3fb.c index 2fe08b67eda7..98aaa330a193 100644 --- a/drivers/video/fbdev/ps3fb.c +++ b/drivers/video/fbdev/ps3fb.c @@ -936,6 +936,7 @@ static irqreturn_t ps3fb_vsync_interrupt(int irq, void *ptr) static const struct fb_ops ps3fb_ops = { + .owner = THIS_MODULE, .fb_open = ps3fb_open, .fb_release = ps3fb_release, .fb_read = fb_sys_read, -- cgit From b04ab8c13a73c10a97126fbe7076b2fbf632ba03 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 24 Apr 2023 10:58:25 +0200 Subject: fbdev: vfb: Init owner field of struct fb_ops Initialize the owner field of struct fb_ops. Required to prevent module unloading while the driver is in use. Signed-off-by: Thomas Zimmermann Signed-off-by: Helge Deller --- drivers/video/fbdev/vfb.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/vfb.c b/drivers/video/fbdev/vfb.c index 1a2514d564fc..a94573997d15 100644 --- a/drivers/video/fbdev/vfb.c +++ b/drivers/video/fbdev/vfb.c @@ -79,6 +79,7 @@ static int vfb_mmap(struct fb_info *info, struct vm_area_struct *vma); static const struct fb_ops vfb_ops = { + .owner = THIS_MODULE, .fb_read = fb_sys_read, .fb_write = fb_sys_write, .fb_check_var = vfb_check_var, -- cgit