Skip to contentSkip to conversation

leds-mc13783: set platform data to NULL at mc13783_led_remove

PATCH In review Devendra Naga 2 participants 5 messages Jul 2, 2012 – Jul 3, 2012 LED

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 leds-mc13783: set platform data to NULL at mc13783_led_remove

the platform_set_drvdata (pdev, NULL) to be set at the remove of the driver, as we have set the platform data to led at probe.

---
 drivers/leds/leds-mc13783.c |    1 +
 1 file changed, 1 insertion(+)
drivers/leds/leds-mc13783.c +1 -0
index 4cc6a2e..6515c11 100644
@@ -372,6 +372,7 @@ static int __devexit mc13783_led_remove(struct platform_device *pdev)
 
 	mc13xxx_unlock(dev);
 
+	platform_set_drvdata(pdev, NULL);
 	kfree(led);
 	return 0;
 }
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 4 lines · Devendra Naga

the platform_set_drvdata (pdev, NULL) to be set at the remove of the driver, as we have set the platform data to led at probe.

Nice catch. I applied this patch in my for-next branch.

But I also find the same issue in other LED drivers, are you interested in fixing them?

Thanks,
-Bryan

Quoted 19 lines
---
 drivers/leds/leds-mc13783.c |    1 +
 1 file changed, 1 insertion(+)
drivers/leds/leds-mc13783.c +1 -1
index 4cc6a2e..6515c11 100644
@@ -372,6 +372,7 @@ static int __devexit mc13783_led_remove(struct platform_device *pdev)
 
        mc13xxx_unlock(dev);
 
+       platform_set_drvdata(pdev, NULL);
        kfree(led);
        return 0;
 }
--

1.7.9.5

Signature · 4 lines
Bryan Wu <[email protected]>
Kernel Developer    +86.186-168-78255 Mobile
Canonical Ltd.      www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com
#2 lore raw
Quoted 11 lines · Bryan Wu
Quoted 4 lines · Devendra Naga

the platform_set_drvdata (pdev, NULL) to be set at the remove of the driver, as we have set the platform data to led at probe.

Nice catch. I applied this patch in my for-next branch.

But I also find the same issue in other LED drivers, are you interested in fixing them?

Yes, i will do those.
I will send out changes...

Quoted 3 lines

Thanks,
-Bryan

Thanks

Quoted 27 lines
Quoted 17 lines
---
 drivers/leds/leds-mc13783.c |    1 +
 1 file changed, 1 insertion(+)
drivers/leds/leds-mc13783.c +1 -1
index 4cc6a2e..6515c11 100644
@@ -372,6 +372,7 @@ static int __devexit mc13783_led_remove(struct platform_device *pdev)
 
        mc13xxx_unlock(dev);
 
+       platform_set_drvdata(pdev, NULL);
        kfree(led);
        return 0;
 }
--
Quoted 2 lines

1.7.9.5

--
Bryan Wu <[email protected]>
Kernel Developer +86.186-168-78255 Mobile
Canonical Ltd. www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com

#3 lore raw

Hi Bryan,

I Made all the necessary changes, and it touched 21 drivers overall, and i compile tested all except leds-sunfire as i dont have a cross-toolchain for that.
all patches are compile tested with

gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, ( my machine's) arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-2012.05-20120523 - Linaro GCC 2012.05) 4.7.1 20120514 (prerelease) (ARM toolchain's)

at each cross-compile of a driver i selected the defconfig of each machine, fox ex. for leds-netxbig i chose kirkwood-defconfig, and for leds-s3c24xx i chose s3c2410_defconfig.

Now i have only 1 question in mind :).

do i need to submit all in a single patch? or patch per driver?

Thanks,
Devendra.

#4 lore raw
Quoted 7 lines · devendra.aaru

Hi Bryan,

I Made all the necessary changes, and it touched 21 drivers overall, and i compile tested all except leds-sunfire as i dont have a cross-toolchain for that.
all patches are compile tested with

Quoted 8 lines

gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, ( my machine's) arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-2012.05-20120523 - Linaro GCC 2012.05) 4.7.1 20120514 (prerelease) (ARM toolchain's)

at each cross-compile of a driver i selected the defconfig of each machine, fox ex. for leds-netxbig i chose kirkwood-defconfig, and for leds-s3c24xx i chose s3c2410_defconfig.

Very good, thanks a lot.

Quoted 4 lines

Now i have only 1 question in mind :).

do i need to submit all in a single patch? or patch per driver?

I prefer to one patch per driver and please add the driver maintainers in you Cc list of each patch.

-Bryan