mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jingoo Han <jg1.han@samsung.com>
To: "'Andrew Morton'" <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org,
	"'Richard Purdie'" <rpurdie@rpsys.net>,
	"'Jingoo Han'" <jg1.han@samsung.com>,
	"'Michael Hennerich'" <michael.hennerich@analog.com>
Subject: [PATCH 04/22] backlight: adp8860: use devm_backlight_device_register()
Date: Tue, 24 Sep 2013 18:07:01 +0900	[thread overview]
Message-ID: <004a01ceb905$6e0f3af0$4a2db0d0$%han@samsung.com> (raw)
In-Reply-To: <004701ceb905$03e8da50$0bba8ef0$%han@samsung.com>

Use devm_backlight_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/backlight/adp8860_bl.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c
index 2f77f37..9d65671 100644
--- a/drivers/video/backlight/adp8860_bl.c
+++ b/drivers/video/backlight/adp8860_bl.c
@@ -711,8 +711,9 @@ static int adp8860_probe(struct i2c_client *client,
 
 	mutex_init(&data->lock);
 
-	bl = backlight_device_register(dev_driver_string(&client->dev),
-			&client->dev, data, &adp8860_bl_ops, &props);
+	bl = devm_backlight_device_register(&client->dev,
+				dev_driver_string(&client->dev),
+				&client->dev, data, &adp8860_bl_ops, &props);
 	if (IS_ERR(bl)) {
 		dev_err(&client->dev, "failed to register backlight\n");
 		return PTR_ERR(bl);
@@ -728,7 +729,7 @@ static int adp8860_probe(struct i2c_client *client,
 
 	if (ret) {
 		dev_err(&client->dev, "failed to register sysfs\n");
-		goto out1;
+		return ret;
 	}
 
 	ret = adp8860_bl_setup(bl);
@@ -751,8 +752,6 @@ out:
 	if (data->en_ambl_sens)
 		sysfs_remove_group(&data->bl->dev.kobj,
 			&adp8860_bl_attr_group);
-out1:
-	backlight_device_unregister(bl);
 
 	return ret;
 }
@@ -770,8 +769,6 @@ static int adp8860_remove(struct i2c_client *client)
 		sysfs_remove_group(&data->bl->dev.kobj,
 			&adp8860_bl_attr_group);
 
-	backlight_device_unregister(data->bl);
-
 	return 0;
 }
 
-- 
1.7.10.4



  parent reply	other threads:[~2013-09-24  9:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24  9:04 [PATCH 01/22] backlight: 88pm860x_bl: " Jingoo Han
2013-09-24  9:05 ` [PATCH 02/22] backlight: aat2870: " Jingoo Han
2013-09-24  9:06 ` [PATCH 03/22] backlight: adp5520: " Jingoo Han
2013-09-24  9:07 ` Jingoo Han [this message]
2013-09-24  9:07 ` [PATCH 05/22] backlight: adp8870: " Jingoo Han
2013-09-24  9:09 ` [PATCH 06/22] backlight: as3711_bl: " Jingoo Han
2013-09-24  9:09 ` [PATCH 07/22] backlight: atmel-pwm-bl: " Jingoo Han
2013-09-24  9:10 ` [PATCH 08/22] backlight: bd6107: " Jingoo Han
2013-09-24  9:11 ` [PATCH 09/22] backlight: da903x_bl: " Jingoo Han
2013-09-24  9:13 ` [PATCH 10/22] backlight: da9052_bl: " Jingoo Han
2013-09-24  9:14 ` [PATCH 11/22] backlight: ep93xx: " Jingoo Han
2013-09-24  9:14 ` [PATCH 12/22] backlight: generic_bl: " Jingoo Han
2013-09-24  9:15 ` [PATCH 13/22] backlight: gpio_backlight: " Jingoo Han
2013-09-24  9:16 ` [PATCH 14/22] backlight: kb3886_bl: " Jingoo Han
2013-09-24  9:16 ` [PATCH 15/22] backlight: lm3533_bl: " Jingoo Han
2013-09-24  9:17 ` [PATCH 16/22] backlight: lp855x: " Jingoo Han
2013-09-24  9:17 ` [PATCH 17/22] backlight: lv5207lp: " Jingoo Han
2013-09-24  9:18 ` [PATCH 18/22] backlight: max8925_bl: " Jingoo Han
2013-09-24  9:18 ` [PATCH 19/22] backlight: pandora_bl: " Jingoo Han
2013-09-24  9:19 ` [PATCH 20/22] backlight: pcf50633: " Jingoo Han
2013-09-24  9:20 ` [PATCH 21/22] backlight: tps65217_bl: " Jingoo Han
2013-09-24  9:20 ` [PATCH 22/22] backlight: wm831x_bl: " Jingoo Han

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='004a01ceb905$6e0f3af0$4a2db0d0$%han@samsung.com' \
    --to=jg1.han@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=rpurdie@rpsys.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®