linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] leds: syscon: Use resource managed variant of device register
@ 2019-08-27 13:00 Alexander Dahl
  2019-08-27 21:32 ` Jacek Anaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Dahl @ 2019-08-27 13:00 UTC (permalink / raw)
  To: linux-leds; +Cc: Jacek Anaszewski, Pavel Machek, Dan Murphy, linux-kernel

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>
---
 drivers/leds/leds-syscon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/leds/leds-syscon.c b/drivers/leds/leds-syscon.c
index e35dff0050f0..b58f3cafe16f 100644
--- a/drivers/leds/leds-syscon.c
+++ b/drivers/leds/leds-syscon.c
@@ -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;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] leds: syscon: Use resource managed variant of device register
  2019-08-27 13:00 [PATCH] leds: syscon: Use resource managed variant of device register Alexander Dahl
@ 2019-08-27 21:32 ` Jacek Anaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Jacek Anaszewski @ 2019-08-27 21:32 UTC (permalink / raw)
  To: Alexander Dahl, linux-leds; +Cc: Pavel Machek, Dan Murphy, linux-kernel

Hi Alexander,

Thank you for the patch.

On 8/27/19 3:00 PM, Alexander Dahl wrote:
> 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>
> ---
>  drivers/leds/leds-syscon.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/leds/leds-syscon.c b/drivers/leds/leds-syscon.c
> index e35dff0050f0..b58f3cafe16f 100644
> --- a/drivers/leds/leds-syscon.c
> +++ b/drivers/leds/leds-syscon.c
> @@ -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;

Applied.

-- 
Best regards,
Jacek Anaszewski

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-27 21:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-27 13:00 [PATCH] leds: syscon: Use resource managed variant of device register Alexander Dahl
2019-08-27 21:32 ` Jacek Anaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).