summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev/via
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-03-19 00:54:24 +0100
committerHelge Deller <deller@gmx.de>2023-04-24 11:48:33 +0200
commit87b1e9a57445e4ee38cf1c03c203c82d5dda6aa3 (patch)
treee33e7db2ea5acf9b2720996029993226e1ecfe98 /drivers/video/fbdev/via
parent4a5ef62ce73b3c73ad3f844052b37cbabd9e2357 (diff)
downloadlinux-stable-87b1e9a57445e4ee38cf1c03c203c82d5dda6aa3.tar.gz
linux-stable-87b1e9a57445e4ee38cf1c03c203c82d5dda6aa3.tar.bz2
linux-stable-87b1e9a57445e4ee38cf1c03c203c82d5dda6aa3.zip
fbdev: via: Convert to platform remove callback returning void
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 <u.kleine-koenig@pengutronix.de> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers/video/fbdev/via')
-rw-r--r--drivers/video/fbdev/via/via-gpio.c5
-rw-r--r--drivers/video/fbdev/via/via_i2c.c5
2 files changed, 4 insertions, 6 deletions
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)