leds: Convert all platform drivers to return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Sun, 17 Sep 2023 13:09:47 +0000 (15:09 +0200)
committerLee Jones <lee@kernel.org>
Wed, 1 Nov 2023 11:28:35 +0000 (11:28 +0000)
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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

All platform drivers below drivers/leds/ unconditionally return zero in
their remove callback and so can be converted trivially to the variant
returning void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230917130947.1122198-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Lee Jones <lee@kernel.org>
26 files changed:
drivers/leds/blink/leds-lgm-sso.c
drivers/leds/flash/leds-aat1290.c
drivers/leds/flash/leds-ktd2692.c
drivers/leds/flash/leds-max77693.c
drivers/leds/flash/leds-mt6360.c
drivers/leds/flash/leds-qcom-flash.c
drivers/leds/flash/leds-rt8515.c
drivers/leds/flash/leds-sgm3140.c
drivers/leds/leds-88pm860x.c
drivers/leds/leds-adp5520.c
drivers/leds/leds-clevo-mail.c
drivers/leds/leds-da903x.c
drivers/leds/leds-da9052.c
drivers/leds/leds-lm3533.c
drivers/leds/leds-mc13783.c
drivers/leds/leds-mlxreg.c
drivers/leds/leds-mt6323.c
drivers/leds/leds-nic78bx.c
drivers/leds/leds-powernv.c
drivers/leds/leds-rb532.c
drivers/leds/leds-regulator.c
drivers/leds/leds-sc27xx-bltc.c
drivers/leds/leds-sunfire.c
drivers/leds/leds-wm831x-status.c
drivers/leds/leds-wm8350.c
drivers/leds/rgb/leds-qcom-lpg.c

index 35c61311e7fd8b65122c993e393c44f133757a12..7b04ea146260583d3fc986d2ac46f55159972778 100644 (file)
@@ -837,7 +837,7 @@ static int intel_sso_led_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int intel_sso_led_remove(struct platform_device *pdev)
+static void intel_sso_led_remove(struct platform_device *pdev)
 {
        struct sso_led_priv *priv;
        struct sso_led *led, *n;
@@ -850,8 +850,6 @@ static int intel_sso_led_remove(struct platform_device *pdev)
        }
 
        regmap_exit(priv->mmap);
-
-       return 0;
 }
 
 static const struct of_device_id of_sso_led_match[] = {
@@ -863,7 +861,7 @@ MODULE_DEVICE_TABLE(of, of_sso_led_match);
 
 static struct platform_driver intel_sso_led_driver = {
        .probe          = intel_sso_led_probe,
-       .remove         = intel_sso_led_remove,
+       .remove_new     = intel_sso_led_remove,
        .driver         = {
                        .name = "lgm-ssoled",
                        .of_match_table = of_sso_led_match,
index f12ecb2c658031d815e909a20579bbfb4fe07596..0195935a7c990314059b3d1e9d37487de78d83b9 100644 (file)
@@ -522,7 +522,7 @@ err_flash_register:
        return ret;
 }
 
-static int aat1290_led_remove(struct platform_device *pdev)
+static void aat1290_led_remove(struct platform_device *pdev)
 {
        struct aat1290_led *led = platform_get_drvdata(pdev);
 
@@ -530,8 +530,6 @@ static int aat1290_led_remove(struct platform_device *pdev)
        led_classdev_flash_unregister(&led->fled_cdev);
 
        mutex_destroy(&led->lock);
-
-       return 0;
 }
 
 static const struct of_device_id aat1290_led_dt_match[] = {
@@ -542,7 +540,7 @@ MODULE_DEVICE_TABLE(of, aat1290_led_dt_match);
 
 static struct platform_driver aat1290_led_driver = {
        .probe          = aat1290_led_probe,
-       .remove         = aat1290_led_remove,
+       .remove_new     = aat1290_led_remove,
        .driver         = {
                .name   = "aat1290",
                .of_match_table = aat1290_led_dt_match,
index 670f3bf2e90628c9b9640d78e83e06678eda254a..598eee5daa527137117cd3498c2816066987f557 100644 (file)
@@ -386,15 +386,13 @@ static int ktd2692_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int ktd2692_remove(struct platform_device *pdev)
+static void ktd2692_remove(struct platform_device *pdev)
 {
        struct ktd2692_context *led = platform_get_drvdata(pdev);
 
        led_classdev_flash_unregister(&led->fled_cdev);
 
        mutex_destroy(&led->lock);
-
-       return 0;
 }
 
 static const struct of_device_id ktd2692_match[] = {
@@ -409,7 +407,7 @@ static struct platform_driver ktd2692_driver = {
                .of_match_table = ktd2692_match,
        },
        .probe  = ktd2692_probe,
-       .remove = ktd2692_remove,
+       .remove_new = ktd2692_remove,
 };
 
 module_platform_driver(ktd2692_driver);
index 5c1faeb55a314225847a4d381b8bf4accfe50d3a..9f016b851193c239d316793253411fa6da6428f7 100644 (file)
@@ -1016,7 +1016,7 @@ err_register_led1:
        return ret;
 }
 
-static int max77693_led_remove(struct platform_device *pdev)
+static void max77693_led_remove(struct platform_device *pdev)
 {
        struct max77693_led_device *led = platform_get_drvdata(pdev);
        struct max77693_sub_led *sub_leds = led->sub_leds;
@@ -1032,8 +1032,6 @@ static int max77693_led_remove(struct platform_device *pdev)
        }
 
        mutex_destroy(&led->lock);
-
-       return 0;
 }
 
 static const struct of_device_id max77693_led_dt_match[] = {
@@ -1044,7 +1042,7 @@ MODULE_DEVICE_TABLE(of, max77693_led_dt_match);
 
 static struct platform_driver max77693_led_driver = {
        .probe          = max77693_led_probe,
-       .remove         = max77693_led_remove,
+       .remove_new     = max77693_led_remove,
        .driver         = {
                .name   = "max77693-led",
                .of_match_table = max77693_led_dt_match,
index 1af6c589834348c972164e8e60a553db9402a0d9..81401c481e2b9cfe507441c13946e60c788b8d1d 100644 (file)
@@ -855,12 +855,11 @@ out_flash_release:
        return ret;
 }
 
-static int mt6360_led_remove(struct platform_device *pdev)
+static void mt6360_led_remove(struct platform_device *pdev)
 {
        struct mt6360_priv *priv = platform_get_drvdata(pdev);
 
        mt6360_v4l2_flash_release(priv);
-       return 0;
 }
 
 static const struct of_device_id __maybe_unused mt6360_led_of_id[] = {
@@ -875,7 +874,7 @@ static struct platform_driver mt6360_led_driver = {
                .of_match_table = mt6360_led_of_id,
        },
        .probe = mt6360_led_probe,
-       .remove = mt6360_led_remove,
+       .remove_new = mt6360_led_remove,
 };
 module_platform_driver(mt6360_led_driver);
 
index a73d3ea5c97a3315f94946a5ddcd61c759c7cc21..7c99a303917163ab3ed08b408e224fc46ae3efe2 100644 (file)
@@ -755,7 +755,7 @@ release:
        return rc;
 }
 
-static int qcom_flash_led_remove(struct platform_device *pdev)
+static void qcom_flash_led_remove(struct platform_device *pdev)
 {
        struct qcom_flash_data *flash_data = platform_get_drvdata(pdev);
 
@@ -763,7 +763,6 @@ static int qcom_flash_led_remove(struct platform_device *pdev)
                v4l2_flash_release(flash_data->v4l2_flash[flash_data->leds_count--]);
 
        mutex_destroy(&flash_data->lock);
-       return 0;
 }
 
 static const struct of_device_id qcom_flash_led_match_table[] = {
@@ -778,7 +777,7 @@ static struct platform_driver qcom_flash_led_driver = {
                .of_match_table = qcom_flash_led_match_table,
        },
        .probe = qcom_flash_led_probe,
-       .remove = qcom_flash_led_remove,
+       .remove_new = qcom_flash_led_remove,
 };
 
 module_platform_driver(qcom_flash_led_driver);
index 44904fdee3cc0e40446dfbeb1efe2042cb5a8842..eef426924eafb4512dae70301cd3b1fb32f1424e 100644 (file)
@@ -367,15 +367,13 @@ static int rt8515_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int rt8515_remove(struct platform_device *pdev)
+static void rt8515_remove(struct platform_device *pdev)
 {
        struct rt8515 *rt = platform_get_drvdata(pdev);
 
        rt8515_v4l2_flash_release(rt);
        del_timer_sync(&rt->powerdown_timer);
        mutex_destroy(&rt->lock);
-
-       return 0;
 }
 
 static const struct of_device_id rt8515_match[] = {
@@ -390,7 +388,7 @@ static struct platform_driver rt8515_driver = {
                .of_match_table = rt8515_match,
        },
        .probe  = rt8515_probe,
-       .remove = rt8515_remove,
+       .remove_new = rt8515_remove,
 };
 module_platform_driver(rt8515_driver);
 
index d3f50dca51366097b4e2d57b26759d92122c0855..eb648ff54b4e5507a7090e236a34cb515b96f82d 100644 (file)
@@ -278,15 +278,13 @@ err:
        return ret;
 }
 
-static int sgm3140_remove(struct platform_device *pdev)
+static void sgm3140_remove(struct platform_device *pdev)
 {
        struct sgm3140 *priv = platform_get_drvdata(pdev);
 
        del_timer_sync(&priv->powerdown_timer);
 
        v4l2_flash_release(priv->v4l2_flash);
-
-       return 0;
 }
 
 static const struct of_device_id sgm3140_dt_match[] = {
@@ -299,7 +297,7 @@ MODULE_DEVICE_TABLE(of, sgm3140_dt_match);
 
 static struct platform_driver sgm3140_driver = {
        .probe  = sgm3140_probe,
-       .remove = sgm3140_remove,
+       .remove_new = sgm3140_remove,
        .driver = {
                .name   = "sgm3140",
                .of_match_table = sgm3140_dt_match,
index 508d0d859f2e022c25090feb01498aa81a1e8a3f..033ab5fed38a4bedec4cefaf644f0fb4fcd0db23 100644 (file)
@@ -215,13 +215,11 @@ static int pm860x_led_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int pm860x_led_remove(struct platform_device *pdev)
+static void pm860x_led_remove(struct platform_device *pdev)
 {
        struct pm860x_led *data = platform_get_drvdata(pdev);
 
        led_classdev_unregister(&data->cdev);
-
-       return 0;
 }
 
 static struct platform_driver pm860x_led_driver = {
@@ -229,7 +227,7 @@ static struct platform_driver pm860x_led_driver = {
                .name   = "88pm860x-led",
        },
        .probe  = pm860x_led_probe,
-       .remove = pm860x_led_remove,
+       .remove_new = pm860x_led_remove,
 };
 
 module_platform_driver(pm860x_led_driver);
index 5a0cc7af2df844b4f6432d9dc84e8ff4685017db..d89a4dca50ae4a0133e4d755c5d3a0d8b1296415 100644 (file)
@@ -163,7 +163,7 @@ err:
        return ret;
 }
 
-static int adp5520_led_remove(struct platform_device *pdev)
+static void adp5520_led_remove(struct platform_device *pdev)
 {
        struct adp5520_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct adp5520_led *led;
@@ -177,8 +177,6 @@ static int adp5520_led_remove(struct platform_device *pdev)
        for (i = 0; i < pdata->num_leds; i++) {
                led_classdev_unregister(&led[i].cdev);
        }
-
-       return 0;
 }
 
 static struct platform_driver adp5520_led_driver = {
@@ -186,7 +184,7 @@ static struct platform_driver adp5520_led_driver = {
                .name   = "adp5520-led",
        },
        .probe          = adp5520_led_probe,
-       .remove         = adp5520_led_remove,
+       .remove_new     = adp5520_led_remove,
 };
 
 module_platform_driver(adp5520_led_driver);
index f512e99b976b17d610e1e9b6afbf372d12080168..82da0fe688ade9edb9921f4f8d7072cc360b6565 100644 (file)
@@ -159,14 +159,13 @@ static int __init clevo_mail_led_probe(struct platform_device *pdev)
        return led_classdev_register(&pdev->dev, &clevo_mail_led);
 }
 
-static int clevo_mail_led_remove(struct platform_device *pdev)
+static void clevo_mail_led_remove(struct platform_device *pdev)
 {
        led_classdev_unregister(&clevo_mail_led);
-       return 0;
 }
 
 static struct platform_driver clevo_mail_led_driver = {
-       .remove         = clevo_mail_led_remove,
+       .remove_new     = clevo_mail_led_remove,
        .driver         = {
                .name           = KBUILD_MODNAME,
        },
index 2b5fb00438a2d3e043ef26a13da3605eabe153bf..f067a5f4d3c4921ba9b8cc6a9d2898d022bc4c4a 100644 (file)
@@ -121,13 +121,11 @@ static int da903x_led_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int da903x_led_remove(struct platform_device *pdev)
+static void da903x_led_remove(struct platform_device *pdev)
 {
        struct da903x_led *led = platform_get_drvdata(pdev);
 
        led_classdev_unregister(&led->cdev);
-
-       return 0;
 }
 
 static struct platform_driver da903x_led_driver = {
@@ -135,7 +133,7 @@ static struct platform_driver da903x_led_driver = {
                .name   = "da903x-led",
        },
        .probe          = da903x_led_probe,
-       .remove         = da903x_led_remove,
+       .remove_new     = da903x_led_remove,
 };
 
 module_platform_driver(da903x_led_driver);
index 04060c862bf9557267e72401e0fc129f44e4f76d..64679d62076bbb15b4a205cb60b412e1a6b2f071 100644 (file)
@@ -156,7 +156,7 @@ err:
        return error;
 }
 
-static int da9052_led_remove(struct platform_device *pdev)
+static void da9052_led_remove(struct platform_device *pdev)
 {
        struct da9052_led *led = platform_get_drvdata(pdev);
        struct da9052_pdata *pdata;
@@ -172,8 +172,6 @@ static int da9052_led_remove(struct platform_device *pdev)
                da9052_set_led_brightness(&led[i], LED_OFF);
                led_classdev_unregister(&led[i].cdev);
        }
-
-       return 0;
 }
 
 static struct platform_driver da9052_led_driver = {
@@ -181,7 +179,7 @@ static struct platform_driver da9052_led_driver = {
                .name   = "da9052-leds",
        },
        .probe          = da9052_led_probe,
-       .remove         = da9052_led_remove,
+       .remove_new     = da9052_led_remove,
 };
 
 module_platform_driver(da9052_led_driver);
index bcd414eb47246e514afd16b2298c57ae3872f1ab..a3d33165d262bf89343391a0a8d34f923ece552c 100644 (file)
@@ -718,7 +718,7 @@ err_deregister:
        return ret;
 }
 
-static int lm3533_led_remove(struct platform_device *pdev)
+static void lm3533_led_remove(struct platform_device *pdev)
 {
        struct lm3533_led *led = platform_get_drvdata(pdev);
 
@@ -726,8 +726,6 @@ static int lm3533_led_remove(struct platform_device *pdev)
 
        lm3533_ctrlbank_disable(&led->cb);
        led_classdev_unregister(&led->cdev);
-
-       return 0;
 }
 
 static void lm3533_led_shutdown(struct platform_device *pdev)
@@ -746,7 +744,7 @@ static struct platform_driver lm3533_led_driver = {
                .name = "lm3533-leds",
        },
        .probe          = lm3533_led_probe,
-       .remove         = lm3533_led_remove,
+       .remove_new     = lm3533_led_remove,
        .shutdown       = lm3533_led_shutdown,
 };
 module_platform_driver(lm3533_led_driver);
index 675502c15c2b40d07907d9e576c254ac8de58c50..bbd1d359bba47cff9ce5cd3c1c71c43ed2c2f644 100644 (file)
@@ -261,15 +261,13 @@ static int __init mc13xxx_led_probe(struct platform_device *pdev)
        return ret;
 }
 
-static int mc13xxx_led_remove(struct platform_device *pdev)
+static void mc13xxx_led_remove(struct platform_device *pdev)
 {
        struct mc13xxx_leds *leds = platform_get_drvdata(pdev);
        int i;
 
        for (i = 0; i < leds->num_leds; i++)
                led_classdev_unregister(&leds->led[i].cdev);
-
-       return 0;
 }
 
 static const struct mc13xxx_led_devtype mc13783_led_devtype = {
@@ -305,7 +303,7 @@ static struct platform_driver mc13xxx_led_driver = {
        .driver = {
                .name   = "mc13xxx-led",
        },
-       .remove         = mc13xxx_led_remove,
+       .remove_new     = mc13xxx_led_remove,
        .id_table       = mc13xxx_led_id_table,
 };
 module_platform_driver_probe(mc13xxx_led_driver, mc13xxx_led_probe);
index 39210653acf7fe8c73ff0a006842483102c7bca6..d8e3d5d8d2d0920c0de89425037fdcaa542b9195 100644 (file)
@@ -275,13 +275,11 @@ static int mlxreg_led_probe(struct platform_device *pdev)
        return mlxreg_led_config(priv);
 }
 
-static int mlxreg_led_remove(struct platform_device *pdev)
+static void mlxreg_led_remove(struct platform_device *pdev)
 {
        struct mlxreg_led_priv_data *priv = dev_get_drvdata(&pdev->dev);
 
        mutex_destroy(&priv->access_lock);
-
-       return 0;
 }
 
 static struct platform_driver mlxreg_led_driver = {
@@ -289,7 +287,7 @@ static struct platform_driver mlxreg_led_driver = {
            .name = "leds-mlxreg",
        },
        .probe = mlxreg_led_probe,
-       .remove = mlxreg_led_remove,
+       .remove_new = mlxreg_led_remove,
 };
 
 module_platform_driver(mlxreg_led_driver);
index 24f35bdb55fbf3cfb533afe90f18f54251373be5..40d508510823298580c93b32336998982c39fc1f 100644 (file)
@@ -632,7 +632,7 @@ put_child_node:
        return ret;
 }
 
-static int mt6323_led_remove(struct platform_device *pdev)
+static void mt6323_led_remove(struct platform_device *pdev)
 {
        struct mt6323_leds *leds = platform_get_drvdata(pdev);
        const struct mt6323_regs *regs = leds->pdata->regs;
@@ -647,8 +647,6 @@ static int mt6323_led_remove(struct platform_device *pdev)
                           RG_DRV_32K_CK_PDN);
 
        mutex_destroy(&leds->lock);
-
-       return 0;
 }
 
 static const struct mt6323_regs mt6323_registers = {
@@ -723,7 +721,7 @@ MODULE_DEVICE_TABLE(of, mt6323_led_dt_match);
 
 static struct platform_driver mt6323_led_driver = {
        .probe          = mt6323_led_probe,
-       .remove         = mt6323_led_remove,
+       .remove_new     = mt6323_led_remove,
        .driver         = {
                .name   = "mt6323-led",
                .of_match_table = mt6323_led_dt_match,
index f196f52eec1e2130177cd3d082ac37bd3c651e7b..a86b43dd995ee44948a0d0695df3a5b096477e77 100644 (file)
@@ -167,15 +167,13 @@ static int nic78bx_probe(struct platform_device *pdev)
        return ret;
 }
 
-static int nic78bx_remove(struct platform_device *pdev)
+static void nic78bx_remove(struct platform_device *pdev)
 {
        struct nic78bx_led_data *led_data = platform_get_drvdata(pdev);
 
        /* Lock LED register */
        outb(NIC78BX_LOCK_VALUE,
             led_data->io_base + NIC78BX_LOCK_REG_OFFSET);
-
-       return 0;
 }
 
 static const struct acpi_device_id led_device_ids[] = {
@@ -186,7 +184,7 @@ MODULE_DEVICE_TABLE(acpi, led_device_ids);
 
 static struct platform_driver led_driver = {
        .probe = nic78bx_probe,
-       .remove = nic78bx_remove,
+       .remove_new = nic78bx_remove,
        .driver = {
                .name = KBUILD_MODNAME,
                .acpi_match_table = ACPI_PTR(led_device_ids),
index 743e2cdd0891b3bf96985f8edc14bfff26fbb50a..4f01acb75727dd6282528bd9f2f672dc510fea91 100644 (file)
@@ -309,7 +309,7 @@ out:
 }
 
 /* Platform driver remove */
-static int powernv_led_remove(struct platform_device *pdev)
+static void powernv_led_remove(struct platform_device *pdev)
 {
        struct powernv_led_common *powernv_led_common;
 
@@ -321,7 +321,6 @@ static int powernv_led_remove(struct platform_device *pdev)
        mutex_destroy(&powernv_led_common->lock);
 
        dev_info(&pdev->dev, "PowerNV led module unregistered\n");
-       return 0;
 }
 
 /* Platform driver property match */
@@ -335,7 +334,7 @@ MODULE_DEVICE_TABLE(of, powernv_led_match);
 
 static struct platform_driver powernv_led_driver = {
        .probe  = powernv_led_probe,
-       .remove = powernv_led_remove,
+       .remove_new = powernv_led_remove,
        .driver = {
                .name = "powernv-led-driver",
                .of_match_table = powernv_led_match,
index b6447c1721b4dfc5d28a43e13e4ce0e31777fd93..e66f73879c8e397050102126d2854527da77af53 100644 (file)
@@ -42,15 +42,14 @@ static int rb532_led_probe(struct platform_device *pdev)
        return led_classdev_register(&pdev->dev, &rb532_uled);
 }
 
-static int rb532_led_remove(struct platform_device *pdev)
+static void rb532_led_remove(struct platform_device *pdev)
 {
        led_classdev_unregister(&rb532_uled);
-       return 0;
 }
 
 static struct platform_driver rb532_led_driver = {
        .probe = rb532_led_probe,
-       .remove = rb532_led_remove,
+       .remove_new = rb532_led_remove,
        .driver = {
                .name = "rb532-led",
        },
index 8a8b73b4e35871a193aac606bd92152565f19721..848e929c4a61c888a997e684013fcedf1c2d0b9d 100644 (file)
@@ -173,13 +173,12 @@ static int regulator_led_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int regulator_led_remove(struct platform_device *pdev)
+static void regulator_led_remove(struct platform_device *pdev)
 {
        struct regulator_led *led = platform_get_drvdata(pdev);
 
        led_classdev_unregister(&led->cdev);
        regulator_led_disable(led);
-       return 0;
 }
 
 static const struct of_device_id regulator_led_of_match[] = {
@@ -194,7 +193,7 @@ static struct platform_driver regulator_led_driver = {
                .of_match_table = regulator_led_of_match,
        },
        .probe  = regulator_led_probe,
-       .remove = regulator_led_remove,
+       .remove_new = regulator_led_remove,
 };
 
 module_platform_driver(regulator_led_driver);
index e199ea15e40680ff1053b400f5fdbc931a54683a..af1f00a2f3288cf74a82ee06b8d0368e5ef3f9d2 100644 (file)
@@ -330,12 +330,11 @@ static int sc27xx_led_probe(struct platform_device *pdev)
        return err;
 }
 
-static int sc27xx_led_remove(struct platform_device *pdev)
+static void sc27xx_led_remove(struct platform_device *pdev)
 {
        struct sc27xx_led_priv *priv = platform_get_drvdata(pdev);
 
        mutex_destroy(&priv->lock);
-       return 0;
 }
 
 static const struct of_device_id sc27xx_led_of_match[] = {
@@ -350,7 +349,7 @@ static struct platform_driver sc27xx_led_driver = {
                .of_match_table = sc27xx_led_of_match,
        },
        .probe = sc27xx_led_probe,
-       .remove = sc27xx_led_remove,
+       .remove_new = sc27xx_led_remove,
 };
 
 module_platform_driver(sc27xx_led_driver);
index eba7313719bffb94c2be6a9304ab2a5927bcaede..6fd89efb420aa3b08401d0c617d0fad0a154c0f5 100644 (file)
@@ -163,15 +163,13 @@ static int sunfire_led_generic_probe(struct platform_device *pdev,
        return 0;
 }
 
-static int sunfire_led_generic_remove(struct platform_device *pdev)
+static void sunfire_led_generic_remove(struct platform_device *pdev)
 {
        struct sunfire_drvdata *p = platform_get_drvdata(pdev);
        int i;
 
        for (i = 0; i < NUM_LEDS_PER_BOARD; i++)
                led_classdev_unregister(&p->leds[i].led_cdev);
-
-       return 0;
 }
 
 static struct led_type clockboard_led_types[NUM_LEDS_PER_BOARD] = {
@@ -221,7 +219,7 @@ MODULE_ALIAS("platform:sunfire-fhc-leds");
 
 static struct platform_driver sunfire_clockboard_led_driver = {
        .probe          = sunfire_clockboard_led_probe,
-       .remove         = sunfire_led_generic_remove,
+       .remove_new     = sunfire_led_generic_remove,
        .driver         = {
                .name   = "sunfire-clockboard-leds",
        },
@@ -229,7 +227,7 @@ static struct platform_driver sunfire_clockboard_led_driver = {
 
 static struct platform_driver sunfire_fhc_led_driver = {
        .probe          = sunfire_fhc_led_probe,
-       .remove         = sunfire_led_generic_remove,
+       .remove_new     = sunfire_led_generic_remove,
        .driver         = {
                .name   = "sunfire-fhc-leds",
        },
index c48b80574f02435247e0f7c8701785c0ad874bae..70b32d80f9602b6144bbfb3161cbc315eda8cb75 100644 (file)
@@ -280,13 +280,11 @@ static int wm831x_status_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int wm831x_status_remove(struct platform_device *pdev)
+static void wm831x_status_remove(struct platform_device *pdev)
 {
        struct wm831x_status *drvdata = platform_get_drvdata(pdev);
 
        led_classdev_unregister(&drvdata->cdev);
-
-       return 0;
 }
 
 static struct platform_driver wm831x_status_driver = {
@@ -294,7 +292,7 @@ static struct platform_driver wm831x_status_driver = {
                   .name = "wm831x-status",
                   },
        .probe = wm831x_status_probe,
-       .remove = wm831x_status_remove,
+       .remove_new = wm831x_status_remove,
 };
 
 module_platform_driver(wm831x_status_driver);
index 8f243c4137234b297009a3814c463f115fff1fa0..61cbefa05710e8124b8035dbc9e4d6e71842fa63 100644 (file)
@@ -242,13 +242,12 @@ static int wm8350_led_probe(struct platform_device *pdev)
        return led_classdev_register(&pdev->dev, &led->cdev);
 }
 
-static int wm8350_led_remove(struct platform_device *pdev)
+static void wm8350_led_remove(struct platform_device *pdev)
 {
        struct wm8350_led *led = platform_get_drvdata(pdev);
 
        led_classdev_unregister(&led->cdev);
        wm8350_led_disable(led);
-       return 0;
 }
 
 static struct platform_driver wm8350_led_driver = {
@@ -256,7 +255,7 @@ static struct platform_driver wm8350_led_driver = {
                   .name = "wm8350-led",
                   },
        .probe = wm8350_led_probe,
-       .remove = wm8350_led_remove,
+       .remove_new = wm8350_led_remove,
        .shutdown = wm8350_led_shutdown,
 };
 
index 7d93e02a030a25d6f7cb5985ddb0699a47613cc9..bf03abb94e684bd55938bae4642428ea869c936a 100644 (file)
@@ -1364,13 +1364,11 @@ static int lpg_probe(struct platform_device *pdev)
        return lpg_add_pwm(lpg);
 }
 
-static int lpg_remove(struct platform_device *pdev)
+static void lpg_remove(struct platform_device *pdev)
 {
        struct lpg *lpg = platform_get_drvdata(pdev);
 
        pwmchip_remove(&lpg->pwm);
-
-       return 0;
 }
 
 static const struct lpg_data pm8916_pwm_data = {
@@ -1532,7 +1530,7 @@ MODULE_DEVICE_TABLE(of, lpg_of_table);
 
 static struct platform_driver lpg_driver = {
        .probe = lpg_probe,
-       .remove = lpg_remove,
+       .remove_new = lpg_remove,
        .driver = {
                .name = "qcom-spmi-lpg",
                .of_match_table = lpg_of_table,