mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
ARM: 9049/1: locomo: make locomo bus's remove callback return void
The driver core ignores the return value of struct bus_type::remove because there is only little that can be done. To simplify the quest to make this function return void, let struct locomo_driver::remove return void, too. All users already unconditionally return 0, this commit makes it obvious that returning an error code is a bad idea and ensures future users behave accordingly. Link: https://lore.kernel.org/r/20201126110140.2021758-1-u.kleine-koenig@pengutronix.de Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
This commit is contained in:
committed by
Russell King
parent
074a6bda18
commit
33d6d2bb7e
@@ -838,11 +838,10 @@ static int locomo_bus_remove(struct device *dev)
|
|||||||
{
|
{
|
||||||
struct locomo_dev *ldev = LOCOMO_DEV(dev);
|
struct locomo_dev *ldev = LOCOMO_DEV(dev);
|
||||||
struct locomo_driver *drv = LOCOMO_DRV(dev->driver);
|
struct locomo_driver *drv = LOCOMO_DRV(dev->driver);
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
if (drv->remove)
|
if (drv->remove)
|
||||||
ret = drv->remove(ldev);
|
drv->remove(ldev);
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct bus_type locomo_bus_type = {
|
struct bus_type locomo_bus_type = {
|
||||||
|
@@ -188,7 +188,7 @@ struct locomo_driver {
|
|||||||
struct device_driver drv;
|
struct device_driver drv;
|
||||||
unsigned int devid;
|
unsigned int devid;
|
||||||
int (*probe)(struct locomo_dev *);
|
int (*probe)(struct locomo_dev *);
|
||||||
int (*remove)(struct locomo_dev *);
|
void (*remove)(struct locomo_dev *);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define LOCOMO_DRV(_d) container_of((_d), struct locomo_driver, drv)
|
#define LOCOMO_DRV(_d) container_of((_d), struct locomo_driver, drv)
|
||||||
|
@@ -224,18 +224,12 @@ static int collie_uart_probe(struct locomo_dev *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int collie_uart_remove(struct locomo_dev *dev)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct locomo_driver collie_uart_driver = {
|
static struct locomo_driver collie_uart_driver = {
|
||||||
.drv = {
|
.drv = {
|
||||||
.name = "collie_uart",
|
.name = "collie_uart",
|
||||||
},
|
},
|
||||||
.devid = LOCOMO_DEVID_UART,
|
.devid = LOCOMO_DEVID_UART,
|
||||||
.probe = collie_uart_probe,
|
.probe = collie_uart_probe,
|
||||||
.remove = collie_uart_remove,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init collie_uart_init(void)
|
static int __init collie_uart_init(void)
|
||||||
|
@@ -304,7 +304,7 @@ static int locomokbd_probe(struct locomo_dev *dev)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int locomokbd_remove(struct locomo_dev *dev)
|
static void locomokbd_remove(struct locomo_dev *dev)
|
||||||
{
|
{
|
||||||
struct locomokbd *locomokbd = locomo_get_drvdata(dev);
|
struct locomokbd *locomokbd = locomo_get_drvdata(dev);
|
||||||
|
|
||||||
@@ -318,8 +318,6 @@ static int locomokbd_remove(struct locomo_dev *dev)
|
|||||||
release_mem_region((unsigned long) dev->mapbase, dev->length);
|
release_mem_region((unsigned long) dev->mapbase, dev->length);
|
||||||
|
|
||||||
kfree(locomokbd);
|
kfree(locomokbd);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct locomo_driver keyboard_driver = {
|
static struct locomo_driver keyboard_driver = {
|
||||||
|
@@ -208,7 +208,7 @@ static int locomolcd_probe(struct locomo_dev *ldev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int locomolcd_remove(struct locomo_dev *dev)
|
static void locomolcd_remove(struct locomo_dev *dev)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
@@ -220,7 +220,6 @@ static int locomolcd_remove(struct locomo_dev *dev)
|
|||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
locomolcd_dev = NULL;
|
locomolcd_dev = NULL;
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct locomo_driver poodle_lcd_driver = {
|
static struct locomo_driver poodle_lcd_driver = {
|
||||||
|
Reference in New Issue
Block a user