]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
leds: syscon: Use resource managed variant of device register
authorAlexander Dahl <ada@thorsis.com>
Tue, 27 Aug 2019 13:00:27 +0000 (15:00 +0200)
committerJacek Anaszewski <jacek.anaszewski@gmail.com>
Sun, 1 Sep 2019 11:33:27 +0000 (13:33 +0200)
We have a MFD driver compiled as module instantiating this driver. When
unloading that module, those LED devices are not removed, which produces
conflicts, when that module is inserted again.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
drivers/leds/leds-syscon.c

index e35dff0050f0a2eb1d97156b46ccc762172cacd5..b58f3cafe16f4bf8324c21b6abf49025ea56d8f5 100644 (file)
@@ -115,7 +115,7 @@ static int syscon_led_probe(struct platform_device *pdev)
        }
        sled->cdev.brightness_set = syscon_led_set;
 
-       ret = led_classdev_register(dev, &sled->cdev);
+       ret = devm_led_classdev_register(dev, &sled->cdev);
        if (ret < 0)
                return ret;