Merge tag 'perf-tools-for-v5.15-2021-09-11' of git://git.kernel.org/pub/scm/linux...
[linux-2.6-microblaze.git] / drivers / pwm / pwm-twl-led.c
index 6c8df5f..49d9f7a 100644 (file)
@@ -276,7 +276,6 @@ static const struct pwm_ops twl6030_pwmled_ops = {
 static int twl_pwmled_probe(struct platform_device *pdev)
 {
        struct twl_pwmled_chip *twl;
-       int ret;
 
        twl = devm_kzalloc(&pdev->dev, sizeof(*twl), GFP_KERNEL);
        if (!twl)
@@ -294,20 +293,7 @@ static int twl_pwmled_probe(struct platform_device *pdev)
 
        mutex_init(&twl->mutex);
 
-       ret = pwmchip_add(&twl->chip);
-       if (ret < 0)
-               return ret;
-
-       platform_set_drvdata(pdev, twl);
-
-       return 0;
-}
-
-static int twl_pwmled_remove(struct platform_device *pdev)
-{
-       struct twl_pwmled_chip *twl = platform_get_drvdata(pdev);
-
-       return pwmchip_remove(&twl->chip);
+       return devm_pwmchip_add(&pdev->dev, &twl->chip);
 }
 
 #ifdef CONFIG_OF
@@ -325,7 +311,6 @@ static struct platform_driver twl_pwmled_driver = {
                .of_match_table = of_match_ptr(twl_pwmled_of_match),
        },
        .probe = twl_pwmled_probe,
-       .remove = twl_pwmled_remove,
 };
 module_platform_driver(twl_pwmled_driver);