public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] leds: Use devm_led_classdev_register
@ 2016-03-07 14:50 Amitoj Kaur Chawla
  2016-03-07 14:50 ` [PATCH 1/7] leds: 88pm860x: " Amitoj Kaur Chawla
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Amitoj Kaur Chawla @ 2016-03-07 14:50 UTC (permalink / raw)
  To: rpurdie, j.anaszewski, linux-leds, linux-kernel; +Cc: julia.lawall

Switch to resource-managed function devm_led_classdev_register instead
of led_classdev_register and remove unneeded led_classdev_unregister.

The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@platform@
identifier p, probefn, removefn;
@@
struct platform_driver p = {
  .probe = probefn,
  .remove = removefn,
};

@prb@
identifier platform.probefn, pdev;
expression e;
@@
probefn(struct platform_device *pdev, ...) {
  ...
  e =
- led_classdev_register
+ devm_led_classdev_register
  (...);
   ...
?- led_classdev_unregister(...);
  ...
}
@remove depends on prb@
identifier platform.removefn;
@@
removefn(...) {
...
?- led_classdev_unregister(...);
...
}
//</smpl>

Amitoj Kaur Chawla (7):
  leds: 88pm860x: Use devm_led_classdev_register
  leds: lp8788: Use devm_led_classdev_register
  leds: wm381x-status: Use devm_led_classdev_register
  leds: s3c24xx: Use devm_led_classdev_register
  leds: da903x: Use devm_led_classdev_register
  leds: max8997: Use devm_led_classdev_register
  leds: lm3533: Use devm_led_classdev_register

 drivers/leds/leds-88pm860x.c      | 11 +----------
 drivers/leds/leds-da903x.c        | 11 +----------
 drivers/leds/leds-lm3533.c        | 12 +++---------
 drivers/leds/leds-lp8788.c        | 12 +-----------
 drivers/leds/leds-max8997.c       | 12 +-----------
 drivers/leds/leds-s3c24xx.c       | 12 +-----------
 drivers/leds/leds-wm831x-status.c | 12 +-----------
 7 files changed, 9 insertions(+), 73 deletions(-)

-- 
1.9.1

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

* [PATCH 1/7] leds: 88pm860x: Use devm_led_classdev_register
  2016-03-07 14:50 [PATCH 0/7] leds: Use devm_led_classdev_register Amitoj Kaur Chawla
@ 2016-03-07 14:50 ` Amitoj Kaur Chawla
  2016-03-07 14:51 ` [PATCH 2/7] leds: lp8788: " Amitoj Kaur Chawla
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Amitoj Kaur Chawla @ 2016-03-07 14:50 UTC (permalink / raw)
  To: rpurdie, j.anaszewski, linux-leds, linux-kernel; +Cc: julia.lawall

Switch to resource-managed function devm_led_classdev_register instead
of led_classdev_register and remove unneeded led_classdev_unregister.

Also, remove pm860x_led_remove as it is now has nothing to do.

The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@platform@
identifier p, probefn, removefn;
@@
struct platform_driver p = {
  .probe = probefn,
  .remove = removefn,
};

@prb@
identifier platform.probefn, pdev;
expression e;
@@
probefn(struct platform_device *pdev, ...) {
  ...
  e =
- led_classdev_register
+ devm_led_classdev_register
  (...);
   ...
?- led_classdev_unregister(...);
  ...
}
@remove depends on prb@
identifier platform.removefn;
@@
removefn(...) {
...
?- led_classdev_unregister(...);
...
}
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 drivers/leds/leds-88pm860x.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/leds/leds-88pm860x.c b/drivers/leds/leds-88pm860x.c
index 1ad4d03..16cfb3d 100644
--- a/drivers/leds/leds-88pm860x.c
+++ b/drivers/leds/leds-88pm860x.c
@@ -208,7 +208,7 @@ static int pm860x_led_probe(struct platform_device *pdev)
 	data->cdev.brightness_set_blocking = pm860x_led_set;
 	mutex_init(&data->lock);
 
-	ret = led_classdev_register(chip->dev, &data->cdev);
+	ret = devm_led_classdev_register(chip->dev, &data->cdev);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to register LED: %d\n", ret);
 		return ret;
@@ -217,21 +217,12 @@ static int pm860x_led_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int 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 = {
 	.driver	= {
 		.name	= "88pm860x-led",
 	},
 	.probe	= pm860x_led_probe,
-	.remove	= pm860x_led_remove,
 };
 
 module_platform_driver(pm860x_led_driver);
-- 
1.9.1

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

* [PATCH 2/7] leds: lp8788: Use devm_led_classdev_register
  2016-03-07 14:50 [PATCH 0/7] leds: Use devm_led_classdev_register Amitoj Kaur Chawla
  2016-03-07 14:50 ` [PATCH 1/7] leds: 88pm860x: " Amitoj Kaur Chawla
@ 2016-03-07 14:51 ` Amitoj Kaur Chawla
  2016-03-07 14:51 ` [PATCH 3/7] leds: wm381x-status: " Amitoj Kaur Chawla
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Amitoj Kaur Chawla @ 2016-03-07 14:51 UTC (permalink / raw)
  To: rpurdie, j.anaszewski, linux-leds, linux-kernel; +Cc: julia.lawall

Switch to resource-managed function devm_led_classdev_register instead
of led_classdev_register and remove unneeded led_classdev_unregister.

Also, remove lp8788_led_remove as it is now has nothing to do.

The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@platform@
identifier p, probefn, removefn;
@@
struct platform_driver p = {
  .probe = probefn,
  .remove = removefn,
};

@prb@
identifier platform.probefn, pdev;
expression e;
@@
probefn(struct platform_device *pdev, ...) {
  ...
  e =
- led_classdev_register
+ devm_led_classdev_register
  (...);
   ...
?- led_classdev_unregister(...);
  ...
}
@remove depends on prb@
identifier platform.removefn;
@@
removefn(...) {
...
?- led_classdev_unregister(...);
...
}
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 drivers/leds/leds-lp8788.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/leds/leds-lp8788.c b/drivers/leds/leds-lp8788.c
index 0eee38f..ffc3f89 100644
--- a/drivers/leds/leds-lp8788.c
+++ b/drivers/leds/leds-lp8788.c
@@ -154,7 +154,7 @@ static int lp8788_led_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = led_classdev_register(dev, &led->led_dev);
+	ret = devm_led_classdev_register(dev, &led->led_dev);
 	if (ret) {
 		dev_err(dev, "led register err: %d\n", ret);
 		return ret;
@@ -163,18 +163,8 @@ static int lp8788_led_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int lp8788_led_remove(struct platform_device *pdev)
-{
-	struct lp8788_led *led = platform_get_drvdata(pdev);
-
-	led_classdev_unregister(&led->led_dev);
-
-	return 0;
-}
-
 static struct platform_driver lp8788_led_driver = {
 	.probe = lp8788_led_probe,
-	.remove = lp8788_led_remove,
 	.driver = {
 		.name = LP8788_DEV_KEYLED,
 	},
-- 
1.9.1

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

* [PATCH 3/7] leds: wm381x-status: Use devm_led_classdev_register
  2016-03-07 14:50 [PATCH 0/7] leds: Use devm_led_classdev_register Amitoj Kaur Chawla
  2016-03-07 14:50 ` [PATCH 1/7] leds: 88pm860x: " Amitoj Kaur Chawla
  2016-03-07 14:51 ` [PATCH 2/7] leds: lp8788: " Amitoj Kaur Chawla
@ 2016-03-07 14:51 ` Amitoj Kaur Chawla
  2016-03-07 14:51 ` [PATCH 4/7] leds: s3c24xx: " Amitoj Kaur Chawla
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Amitoj Kaur Chawla @ 2016-03-07 14:51 UTC (permalink / raw)
  To: rpurdie, j.anaszewski, linux-leds, linux-kernel; +Cc: julia.lawall

Switch to resource-managed function devm_led_classdev_register instead
of led_classdev_register and remove unneeded led_classdev_unregister.

Also, remove wm831x_status_remove as it is now has nothing to do.

The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@platform@
identifier p, probefn, removefn;
@@
struct platform_driver p = {
  .probe = probefn,
  .remove = removefn,
};

@prb@
identifier platform.probefn, pdev;
expression e;
@@
probefn(struct platform_device *pdev, ...) {
  ...
  e =
- led_classdev_register
+ devm_led_classdev_register
  (...);
   ...
?- led_classdev_unregister(...);
  ...
}
@remove depends on prb@
identifier platform.removefn;
@@
removefn(...) {
...
?- led_classdev_unregister(...);
...
}
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 drivers/leds/leds-wm831x-status.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/leds/leds-wm831x-status.c b/drivers/leds/leds-wm831x-status.c
index 64a2226..5722b94a 100644
--- a/drivers/leds/leds-wm831x-status.c
+++ b/drivers/leds/leds-wm831x-status.c
@@ -284,7 +284,7 @@ static int wm831x_status_probe(struct platform_device *pdev)
 	drvdata->cdev.blink_set = wm831x_status_blink_set;
 	drvdata->cdev.groups = wm831x_status_groups;
 
-	ret = led_classdev_register(wm831x->dev, &drvdata->cdev);
+	ret = devm_led_classdev_register(wm831x->dev, &drvdata->cdev);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to register LED: %d\n", ret);
 		return ret;
@@ -293,21 +293,11 @@ static int wm831x_status_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int 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 = {
 	.driver = {
 		   .name = "wm831x-status",
 		   },
 	.probe = wm831x_status_probe,
-	.remove = wm831x_status_remove,
 };
 
 module_platform_driver(wm831x_status_driver);
-- 
1.9.1

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

* [PATCH 4/7] leds: s3c24xx: Use devm_led_classdev_register
  2016-03-07 14:50 [PATCH 0/7] leds: Use devm_led_classdev_register Amitoj Kaur Chawla
                   ` (2 preceding siblings ...)
  2016-03-07 14:51 ` [PATCH 3/7] leds: wm381x-status: " Amitoj Kaur Chawla
@ 2016-03-07 14:51 ` Amitoj Kaur Chawla
  2016-03-07 14:51 ` [PATCH 5/7] leds: da903x: " Amitoj Kaur Chawla
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Amitoj Kaur Chawla @ 2016-03-07 14:51 UTC (permalink / raw)
  To: rpurdie, j.anaszewski, linux-leds, linux-kernel; +Cc: julia.lawall

Switch to resource-managed function devm_led_classdev_register instead
of led_classdev_register and remove unneeded led_classdev_unregister.

Also, remove s3c24xx_led_remove as it is now has nothing to do.

The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@platform@
identifier p, probefn, removefn;
@@
struct platform_driver p = {
  .probe = probefn,
  .remove = removefn,
};

@prb@
identifier platform.probefn, pdev;
expression e;
@@
probefn(struct platform_device *pdev, ...) {
  ...
  e =
- led_classdev_register
+ devm_led_classdev_register
  (...);
   ...
?- led_classdev_unregister(...);
  ...
}
@remove depends on prb@
identifier platform.removefn;
@@
removefn(...) {
...
?- led_classdev_unregister(...);
...
}
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 drivers/leds/leds-s3c24xx.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c
index 83641a7..ae3fbed 100644
--- a/drivers/leds/leds-s3c24xx.c
+++ b/drivers/leds/leds-s3c24xx.c
@@ -59,15 +59,6 @@ static void s3c24xx_led_set(struct led_classdev *led_cdev,
 	}
 }
 
-static int s3c24xx_led_remove(struct platform_device *dev)
-{
-	struct s3c24xx_gpio_led *led = pdev_to_gpio(dev);
-
-	led_classdev_unregister(&led->cdev);
-
-	return 0;
-}
-
 static int s3c24xx_led_probe(struct platform_device *dev)
 {
 	struct s3c24xx_led_platdata *pdata = dev_get_platdata(&dev->dev);
@@ -104,7 +95,7 @@ static int s3c24xx_led_probe(struct platform_device *dev)
 
 	/* register our new led device */
 
-	ret = led_classdev_register(&dev->dev, &led->cdev);
+	ret = devm_led_classdev_register(&dev->dev, &led->cdev);
 	if (ret < 0)
 		dev_err(&dev->dev, "led_classdev_register failed\n");
 
@@ -113,7 +104,6 @@ static int s3c24xx_led_probe(struct platform_device *dev)
 
 static struct platform_driver s3c24xx_led_driver = {
 	.probe		= s3c24xx_led_probe,
-	.remove		= s3c24xx_led_remove,
 	.driver		= {
 		.name		= "s3c24xx_led",
 	},
-- 
1.9.1

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

* [PATCH 5/7] leds: da903x: Use devm_led_classdev_register
  2016-03-07 14:50 [PATCH 0/7] leds: Use devm_led_classdev_register Amitoj Kaur Chawla
                   ` (3 preceding siblings ...)
  2016-03-07 14:51 ` [PATCH 4/7] leds: s3c24xx: " Amitoj Kaur Chawla
@ 2016-03-07 14:51 ` Amitoj Kaur Chawla
  2016-03-07 14:51 ` [PATCH 6/7] leds: max8997: " Amitoj Kaur Chawla
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Amitoj Kaur Chawla @ 2016-03-07 14:51 UTC (permalink / raw)
  To: rpurdie, j.anaszewski, linux-leds, linux-kernel; +Cc: julia.lawall

Switch to resource-managed function devm_led_classdev_register instead
of led_classdev_register and remove unneeded led_classdev_unregister.

Also, remove da903x_led_remove as it is now has nothing to do.

The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@platform@
identifier p, probefn, removefn;
@@
struct platform_driver p = {
  .probe = probefn,
  .remove = removefn,
};

@prb@
identifier platform.probefn, pdev;
expression e;
@@
probefn(struct platform_device *pdev, ...) {
  ...
  e =
- led_classdev_register
+ devm_led_classdev_register
  (...);
   ...
?- led_classdev_unregister(...);
  ...
}
@remove depends on prb@
identifier platform.removefn;
@@
removefn(...) {
...
?- led_classdev_unregister(...);
...
}
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 drivers/leds/leds-da903x.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/leds/leds-da903x.c b/drivers/leds/leds-da903x.c
index 4752a2b..3e0aab9 100644
--- a/drivers/leds/leds-da903x.c
+++ b/drivers/leds/leds-da903x.c
@@ -113,7 +113,7 @@ static int da903x_led_probe(struct platform_device *pdev)
 	led->flags = pdata->flags;
 	led->master = pdev->dev.parent;
 
-	ret = led_classdev_register(led->master, &led->cdev);
+	ret = devm_led_classdev_register(led->master, &led->cdev);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register LED %d\n", id);
 		return ret;
@@ -123,20 +123,11 @@ static int da903x_led_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int 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 = {
 	.driver	= {
 		.name	= "da903x-led",
 	},
 	.probe		= da903x_led_probe,
-	.remove		= da903x_led_remove,
 };
 
 module_platform_driver(da903x_led_driver);
-- 
1.9.1

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

* [PATCH 6/7] leds: max8997: Use devm_led_classdev_register
  2016-03-07 14:50 [PATCH 0/7] leds: Use devm_led_classdev_register Amitoj Kaur Chawla
                   ` (4 preceding siblings ...)
  2016-03-07 14:51 ` [PATCH 5/7] leds: da903x: " Amitoj Kaur Chawla
@ 2016-03-07 14:51 ` Amitoj Kaur Chawla
  2016-03-07 14:51 ` [PATCH 7/7] leds: lm3533: " Amitoj Kaur Chawla
  2016-03-08  8:26 ` [PATCH 0/7] leds: " Jacek Anaszewski
  7 siblings, 0 replies; 10+ messages in thread
From: Amitoj Kaur Chawla @ 2016-03-07 14:51 UTC (permalink / raw)
  To: rpurdie, j.anaszewski, linux-leds, linux-kernel; +Cc: julia.lawall

Switch to resource-managed function devm_led_classdev_register instead
of led_classdev_register and remove unneeded led_classdev_unregister.

Also, remove max8997_led_remove as it is now has nothing to do.

The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@platform@
identifier p, probefn, removefn;
@@
struct platform_driver p = {
  .probe = probefn,
  .remove = removefn,
};

@prb@
identifier platform.probefn, pdev;
expression e;
@@
probefn(struct platform_device *pdev, ...) {
  ...
  e =
- led_classdev_register
+ devm_led_classdev_register
  (...);
   ...
?- led_classdev_unregister(...);
  ...
}
@remove depends on prb@
identifier platform.removefn;
@@
removefn(...) {
...
?- led_classdev_unregister(...);
...
}
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 drivers/leds/leds-max8997.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/leds/leds-max8997.c b/drivers/leds/leds-max8997.c
index 01b45906..2387e35 100644
--- a/drivers/leds/leds-max8997.c
+++ b/drivers/leds/leds-max8997.c
@@ -283,28 +283,18 @@ static int max8997_led_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, led);
 
-	ret = led_classdev_register(&pdev->dev, &led->cdev);
+	ret = devm_led_classdev_register(&pdev->dev, &led->cdev);
 	if (ret < 0)
 		return ret;
 
 	return 0;
 }
 
-static int max8997_led_remove(struct platform_device *pdev)
-{
-	struct max8997_led *led = platform_get_drvdata(pdev);
-
-	led_classdev_unregister(&led->cdev);
-
-	return 0;
-}
-
 static struct platform_driver max8997_led_driver = {
 	.driver = {
 		.name  = "max8997-led",
 	},
 	.probe  = max8997_led_probe,
-	.remove = max8997_led_remove,
 };
 
 module_platform_driver(max8997_led_driver);
-- 
1.9.1

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

* [PATCH 7/7] leds: lm3533: Use devm_led_classdev_register
  2016-03-07 14:50 [PATCH 0/7] leds: Use devm_led_classdev_register Amitoj Kaur Chawla
                   ` (5 preceding siblings ...)
  2016-03-07 14:51 ` [PATCH 6/7] leds: max8997: " Amitoj Kaur Chawla
@ 2016-03-07 14:51 ` Amitoj Kaur Chawla
  2016-03-08  8:26 ` [PATCH 0/7] leds: " Jacek Anaszewski
  7 siblings, 0 replies; 10+ messages in thread
From: Amitoj Kaur Chawla @ 2016-03-07 14:51 UTC (permalink / raw)
  To: rpurdie, j.anaszewski, linux-leds, linux-kernel; +Cc: julia.lawall

Switch to resource-managed function devm_led_classdev_register instead
of led_classdev_register and remove unneeded led_classdev_unregister.

To be compatible with this change, remove an unnecessary label by
replacing it with direct return statement.

The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@platform@
identifier p, probefn, removefn;
@@
struct platform_driver p = {
  .probe = probefn,
  .remove = removefn,
};

@prb@
identifier platform.probefn, pdev;
expression e;
@@
probefn(struct platform_device *pdev, ...) {
  ...
  e =
- led_classdev_register
+ devm_led_classdev_register
  (...);
   ...
?- led_classdev_unregister(...);
  ...
}
@remove depends on prb@
identifier platform.removefn;
@@
removefn(...) {
...
?- led_classdev_unregister(...);
...
}
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 drivers/leds/leds-lm3533.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/leds/leds-lm3533.c b/drivers/leds/leds-lm3533.c
index 196dcb5..5b529dc 100644
--- a/drivers/leds/leds-lm3533.c
+++ b/drivers/leds/leds-lm3533.c
@@ -698,7 +698,7 @@ static int lm3533_led_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, led);
 
-	ret = led_classdev_register(pdev->dev.parent, &led->cdev);
+	ret = devm_led_classdev_register(pdev->dev.parent, &led->cdev);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register LED %d\n", pdev->id);
 		return ret;
@@ -708,18 +708,13 @@ static int lm3533_led_probe(struct platform_device *pdev)
 
 	ret = lm3533_led_setup(led, pdata);
 	if (ret)
-		goto err_unregister;
+		return ret;
 
 	ret = lm3533_ctrlbank_enable(&led->cb);
 	if (ret)
-		goto err_unregister;
+		return ret;
 
 	return 0;
-
-err_unregister:
-	led_classdev_unregister(&led->cdev);
-
-	return ret;
 }
 
 static int lm3533_led_remove(struct platform_device *pdev)
@@ -729,7 +724,6 @@ static int lm3533_led_remove(struct platform_device *pdev)
 	dev_dbg(&pdev->dev, "%s\n", __func__);
 
 	lm3533_ctrlbank_disable(&led->cb);
-	led_classdev_unregister(&led->cdev);
 
 	return 0;
 }
-- 
1.9.1

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

* Re: [PATCH 0/7] leds: Use devm_led_classdev_register
  2016-03-07 14:50 [PATCH 0/7] leds: Use devm_led_classdev_register Amitoj Kaur Chawla
                   ` (6 preceding siblings ...)
  2016-03-07 14:51 ` [PATCH 7/7] leds: lm3533: " Amitoj Kaur Chawla
@ 2016-03-08  8:26 ` Jacek Anaszewski
  2016-03-08 12:42   ` Amitoj Kaur Chawla
  7 siblings, 1 reply; 10+ messages in thread
From: Jacek Anaszewski @ 2016-03-08  8:26 UTC (permalink / raw)
  To: Amitoj Kaur Chawla; +Cc: rpurdie, linux-leds, linux-kernel, julia.lawall

Hi Amitoj,

Thanks for the patches.

Applied only the 7/7 one. In the remaining ones, please remove
also all occurrences of platform_set_drvdata() in the probe()
and pdev_to_gpio() definition from leds-s3c24xx.cm as they will
be no longer required.

Best regards,
Jacek Anaszewski

On 03/07/2016 03:50 PM, Amitoj Kaur Chawla wrote:
> Switch to resource-managed function devm_led_classdev_register instead
> of led_classdev_register and remove unneeded led_classdev_unregister.
>
> The Coccinelle semantic patch used to make this change is as follows:
> //<smpl>
> @platform@
> identifier p, probefn, removefn;
> @@
> struct platform_driver p = {
>    .probe = probefn,
>    .remove = removefn,
> };
>
> @prb@
> identifier platform.probefn, pdev;
> expression e;
> @@
> probefn(struct platform_device *pdev, ...) {
>    ...
>    e =
> - led_classdev_register
> + devm_led_classdev_register
>    (...);
>     ...
> ?- led_classdev_unregister(...);
>    ...
> }
> @remove depends on prb@
> identifier platform.removefn;
> @@
> removefn(...) {
> ...
> ?- led_classdev_unregister(...);
> ...
> }
> //</smpl>
>
> Amitoj Kaur Chawla (7):
>    leds: 88pm860x: Use devm_led_classdev_register
>    leds: lp8788: Use devm_led_classdev_register
>    leds: wm381x-status: Use devm_led_classdev_register
>    leds: s3c24xx: Use devm_led_classdev_register
>    leds: da903x: Use devm_led_classdev_register
>    leds: max8997: Use devm_led_classdev_register
>    leds: lm3533: Use devm_led_classdev_register
>
>   drivers/leds/leds-88pm860x.c      | 11 +----------
>   drivers/leds/leds-da903x.c        | 11 +----------
>   drivers/leds/leds-lm3533.c        | 12 +++---------
>   drivers/leds/leds-lp8788.c        | 12 +-----------
>   drivers/leds/leds-max8997.c       | 12 +-----------
>   drivers/leds/leds-s3c24xx.c       | 12 +-----------
>   drivers/leds/leds-wm831x-status.c | 12 +-----------
>   7 files changed, 9 insertions(+), 73 deletions(-)
>

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

* Re: [PATCH 0/7] leds: Use devm_led_classdev_register
  2016-03-08  8:26 ` [PATCH 0/7] leds: " Jacek Anaszewski
@ 2016-03-08 12:42   ` Amitoj Kaur Chawla
  0 siblings, 0 replies; 10+ messages in thread
From: Amitoj Kaur Chawla @ 2016-03-08 12:42 UTC (permalink / raw)
  To: Jacek Anaszewski
  Cc: rpurdie, linux-leds, Linux-Kernel@Vger. Kernel. Org, Julia Lawall

On Tue, Mar 8, 2016 at 1:56 PM, Jacek Anaszewski
<j.anaszewski@samsung.com> wrote:
> Hi Amitoj,
>
> Thanks for the patches.
>
> Applied only the 7/7 one. In the remaining ones, please remove
> also all occurrences of platform_set_drvdata() in the probe()
> and pdev_to_gpio() definition from leds-s3c24xx.cm as they will
> be no longer required.

Okay, thanks for the feedback. Will do.

Amitoj

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

end of thread, other threads:[~2016-03-08 12:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-07 14:50 [PATCH 0/7] leds: Use devm_led_classdev_register Amitoj Kaur Chawla
2016-03-07 14:50 ` [PATCH 1/7] leds: 88pm860x: " Amitoj Kaur Chawla
2016-03-07 14:51 ` [PATCH 2/7] leds: lp8788: " Amitoj Kaur Chawla
2016-03-07 14:51 ` [PATCH 3/7] leds: wm381x-status: " Amitoj Kaur Chawla
2016-03-07 14:51 ` [PATCH 4/7] leds: s3c24xx: " Amitoj Kaur Chawla
2016-03-07 14:51 ` [PATCH 5/7] leds: da903x: " Amitoj Kaur Chawla
2016-03-07 14:51 ` [PATCH 6/7] leds: max8997: " Amitoj Kaur Chawla
2016-03-07 14:51 ` [PATCH 7/7] leds: lm3533: " Amitoj Kaur Chawla
2016-03-08  8:26 ` [PATCH 0/7] leds: " Jacek Anaszewski
2016-03-08 12:42   ` Amitoj Kaur Chawla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox