mei: bus: change remove callback to return void
authorUwe Kleine-König <uwe@kleine-koenig.org>
Mon, 8 Feb 2021 07:37:05 +0000 (08:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Feb 2021 08:30:16 +0000 (09:30 +0100)
The driver core ignores the return value of mei_cl_device_remove() so
passing an error value doesn't solve any problem. As most mei drivers'
remove callbacks return 0 unconditionally and returning a different value
doesn't have any effect, change this prototype to return void and return 0
unconditionally in mei_cl_device_remove(). The only driver that could
return an error value is modified to emit an explicit warning in the error
case.

Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Link: https://lore.kernel.org/r/20210208073705.428185-3-uwe@kleine-koenig.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/bus.c
drivers/misc/mei/hdcp/mei_hdcp.c
drivers/nfc/microread/mei.c
drivers/nfc/pn544/mei.c
drivers/watchdog/mei_wdt.c
include/linux/mei_cl_bus.h

index 393a41330a6b84bf585bc7e1011d8b52fddf8f9f..580074e3259962663d72254c30932804453a34fe 100644 (file)
@@ -881,17 +881,16 @@ static int mei_cl_device_remove(struct device *dev)
 {
        struct mei_cl_device *cldev = to_mei_cl_device(dev);
        struct mei_cl_driver *cldrv = to_mei_cl_driver(dev->driver);
-       int ret = 0;
 
        if (cldrv->remove)
-               ret = cldrv->remove(cldev);
+               cldrv->remove(cldev);
 
        mei_cldev_unregister_callbacks(cldev);
 
        mei_cl_bus_module_put(cldev);
        module_put(THIS_MODULE);
 
-       return ret;
+       return 0;
 }
 
 static ssize_t name_show(struct device *dev, struct device_attribute *a,
index 9ae9669e46eae92d12906d86bcf2ef80c75488aa..8447ad4b7d478dc15c9b37521dda499438a4a764 100644 (file)
@@ -845,16 +845,19 @@ enable_err_exit:
        return ret;
 }
 
-static int mei_hdcp_remove(struct mei_cl_device *cldev)
+static void mei_hdcp_remove(struct mei_cl_device *cldev)
 {
        struct i915_hdcp_comp_master *comp_master =
                                                mei_cldev_get_drvdata(cldev);
+       int ret;
 
        component_master_del(&cldev->dev, &mei_component_master_ops);
        kfree(comp_master);
        mei_cldev_set_drvdata(cldev, NULL);
 
-       return mei_cldev_disable(cldev);
+       ret = mei_cldev_disable(cldev);
+       if (ret)
+               dev_warn(&cldev->dev, "mei_cldev_disable() failed\n");
 }
 
 #define MEI_UUID_HDCP GUID_INIT(0xB638AB7E, 0x94E2, 0x4EA2, 0xA5, \
index 5dad8847a9b35a7156bf6470e9679dcfc9458215..8fa7771085eb80d976b4f976fe0289f5b8a97307 100644 (file)
@@ -44,15 +44,13 @@ static int microread_mei_probe(struct mei_cl_device *cldev,
        return 0;
 }
 
-static int microread_mei_remove(struct mei_cl_device *cldev)
+static void microread_mei_remove(struct mei_cl_device *cldev)
 {
        struct nfc_mei_phy *phy = mei_cldev_get_drvdata(cldev);
 
        microread_remove(phy->hdev);
 
        nfc_mei_phy_free(phy);
-
-       return 0;
 }
 
 static struct mei_cl_device_id microread_mei_tbl[] = {
index 579bc599f545b45c03a45bfb42b6674301895f42..5c10aac085a415d33101aa4c32d339ee5d56c7e2 100644 (file)
@@ -42,7 +42,7 @@ static int pn544_mei_probe(struct mei_cl_device *cldev,
        return 0;
 }
 
-static int pn544_mei_remove(struct mei_cl_device *cldev)
+static void pn544_mei_remove(struct mei_cl_device *cldev)
 {
        struct nfc_mei_phy *phy = mei_cldev_get_drvdata(cldev);
 
@@ -51,8 +51,6 @@ static int pn544_mei_remove(struct mei_cl_device *cldev)
        pn544_hci_remove(phy->hdev);
 
        nfc_mei_phy_free(phy);
-
-       return 0;
 }
 
 static struct mei_cl_device_id pn544_mei_tbl[] = {
index 5391bf3e6b11d944e0cae150a3cac38381c264fe..53165e49c2980596eaf65a1f89c036ff224f13b0 100644 (file)
@@ -619,7 +619,7 @@ err_out:
        return ret;
 }
 
-static int mei_wdt_remove(struct mei_cl_device *cldev)
+static void mei_wdt_remove(struct mei_cl_device *cldev)
 {
        struct mei_wdt *wdt = mei_cldev_get_drvdata(cldev);
 
@@ -636,8 +636,6 @@ static int mei_wdt_remove(struct mei_cl_device *cldev)
        dbgfs_unregister(wdt);
 
        kfree(wdt);
-
-       return 0;
 }
 
 #define MEI_UUID_WD UUID_LE(0x05B79A6F, 0x4628, 0x4D7F, \
index 959ad7d850b4efe9580cf5651aabce65958c9eb8..07f5ef8fc456e1a09a7c6cdfe6282cd4cf1ff45f 100644 (file)
@@ -68,7 +68,7 @@ struct mei_cl_driver {
 
        int (*probe)(struct mei_cl_device *cldev,
                     const struct mei_cl_device_id *id);
-       int (*remove)(struct mei_cl_device *cldev);
+       void (*remove)(struct mei_cl_device *cldev);
 };
 
 int __mei_cldev_driver_register(struct mei_cl_driver *cldrv,