Commit 5f680532 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Greg Kroah-Hartman

firmware: google: make coreboot driver's remove callback return void

All coreboot drivers return 0 unconditionally in their remove callback.
Also the device core ignores the return value of the struct
bus_type::remove(), so make the coreboot remove callback return void
instead of giving driver authors the illusion they could return an error
code here.

All drivers are adapted accordingly.
Signed-off-by: default avatarUwe Kleine-König <uwe@kleine-koenig.org>
Link: https://lore.kernel.org/r/20210126215339.706021-1-uwe@kleine-koenig.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1077d436
...@@ -46,14 +46,13 @@ static int coreboot_bus_probe(struct device *dev) ...@@ -46,14 +46,13 @@ static int coreboot_bus_probe(struct device *dev)
static int coreboot_bus_remove(struct device *dev) static int coreboot_bus_remove(struct device *dev)
{ {
int ret = 0;
struct coreboot_device *device = CB_DEV(dev); struct coreboot_device *device = CB_DEV(dev);
struct coreboot_driver *driver = CB_DRV(dev->driver); struct coreboot_driver *driver = CB_DRV(dev->driver);
if (driver->remove) if (driver->remove)
ret = driver->remove(device); driver->remove(device);
return ret; return 0;
} }
static struct bus_type coreboot_bus_type = { static struct bus_type coreboot_bus_type = {
......
...@@ -72,7 +72,7 @@ struct coreboot_device { ...@@ -72,7 +72,7 @@ struct coreboot_device {
/* A driver for handling devices described in coreboot tables. */ /* A driver for handling devices described in coreboot tables. */
struct coreboot_driver { struct coreboot_driver {
int (*probe)(struct coreboot_device *); int (*probe)(struct coreboot_device *);
int (*remove)(struct coreboot_device *); void (*remove)(struct coreboot_device *);
struct device_driver drv; struct device_driver drv;
u32 tag; u32 tag;
}; };
......
...@@ -72,13 +72,11 @@ static int framebuffer_probe(struct coreboot_device *dev) ...@@ -72,13 +72,11 @@ static int framebuffer_probe(struct coreboot_device *dev)
return PTR_ERR_OR_ZERO(pdev); return PTR_ERR_OR_ZERO(pdev);
} }
static int framebuffer_remove(struct coreboot_device *dev) static void framebuffer_remove(struct coreboot_device *dev)
{ {
struct platform_device *pdev = dev_get_drvdata(&dev->dev); struct platform_device *pdev = dev_get_drvdata(&dev->dev);
platform_device_unregister(pdev); platform_device_unregister(pdev);
return 0;
} }
static struct coreboot_driver framebuffer_driver = { static struct coreboot_driver framebuffer_driver = {
......
...@@ -91,11 +91,9 @@ static int memconsole_probe(struct coreboot_device *dev) ...@@ -91,11 +91,9 @@ static int memconsole_probe(struct coreboot_device *dev)
return memconsole_sysfs_init(); return memconsole_sysfs_init();
} }
static int memconsole_remove(struct coreboot_device *dev) static void memconsole_remove(struct coreboot_device *dev)
{ {
memconsole_exit(); memconsole_exit();
return 0;
} }
static struct coreboot_driver memconsole_driver = { static struct coreboot_driver memconsole_driver = {
......
...@@ -298,14 +298,12 @@ static int vpd_probe(struct coreboot_device *dev) ...@@ -298,14 +298,12 @@ static int vpd_probe(struct coreboot_device *dev)
return 0; return 0;
} }
static int vpd_remove(struct coreboot_device *dev) static void vpd_remove(struct coreboot_device *dev)
{ {
vpd_section_destroy(&ro_vpd); vpd_section_destroy(&ro_vpd);
vpd_section_destroy(&rw_vpd); vpd_section_destroy(&rw_vpd);
kobject_put(vpd_kobj); kobject_put(vpd_kobj);
return 0;
} }
static struct coreboot_driver vpd_driver = { static struct coreboot_driver vpd_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment