firmware: google: make coreboot driver's remove callback return void
authorUwe Kleine-König <uwe@kleine-koenig.org>
Tue, 26 Jan 2021 21:53:39 +0000 (22:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Feb 2021 11:12:43 +0000 (12:12 +0100)
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: Uwe Kleine-König <uwe@kleine-koenig.org>
Link: https://lore.kernel.org/r/20210126215339.706021-1-uwe@kleine-koenig.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/google/coreboot_table.c
drivers/firmware/google/coreboot_table.h
drivers/firmware/google/framebuffer-coreboot.c
drivers/firmware/google/memconsole-coreboot.c
drivers/firmware/google/vpd.c

index 0205987a4fd4f08614e386b294e0bb9330b33ffc..dc83ea118c670d4c99fd234b32b25c1d4fef6a2c 100644 (file)
@@ -46,14 +46,13 @@ static int coreboot_bus_probe(struct device *dev)
 
 static int coreboot_bus_remove(struct device *dev)
 {
-       int ret = 0;
        struct coreboot_device *device = CB_DEV(dev);
        struct coreboot_driver *driver = CB_DRV(dev->driver);
 
        if (driver->remove)
-               ret = driver->remove(device);
+               driver->remove(device);
 
-       return ret;
+       return 0;
 }
 
 static struct bus_type coreboot_bus_type = {
index 7b7b4a6eeddae359d571fe4b4731bfa275502a15..beb778674acdc0601248158d46a18d0bb6c1ce74 100644 (file)
@@ -72,7 +72,7 @@ struct coreboot_device {
 /* A driver for handling devices described in coreboot tables. */
 struct coreboot_driver {
        int (*probe)(struct coreboot_device *);
-       int (*remove)(struct coreboot_device *);
+       void (*remove)(struct coreboot_device *);
        struct device_driver drv;
        u32 tag;
 };
index 916f26adc5955b8c021e607001558ec4028146b1..c6dcc1ef93acfde32a92e043ddb5be6b8c61e52a 100644 (file)
@@ -72,13 +72,11 @@ static int framebuffer_probe(struct coreboot_device *dev)
        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);
 
        platform_device_unregister(pdev);
-
-       return 0;
 }
 
 static struct coreboot_driver framebuffer_driver = {
index d17e4d6ac9bc42d36803460cdd3f104e34b0746f..74b5286518eefbc2df08baffc62f150f4329ffd0 100644 (file)
@@ -91,11 +91,9 @@ static int memconsole_probe(struct coreboot_device *dev)
        return memconsole_sysfs_init();
 }
 
-static int memconsole_remove(struct coreboot_device *dev)
+static void memconsole_remove(struct coreboot_device *dev)
 {
        memconsole_exit();
-
-       return 0;
 }
 
 static struct coreboot_driver memconsole_driver = {
index d23c5c69ab5298313973eb4317c363dc99dab24d..ee6e08c0592b5492d208829191a4321bd29f6f5e 100644 (file)
@@ -298,14 +298,12 @@ static int vpd_probe(struct coreboot_device *dev)
        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(&rw_vpd);
 
        kobject_put(vpd_kobj);
-
-       return 0;
 }
 
 static struct coreboot_driver vpd_driver = {