Skip to contentSkip to conversation

+ backlight-ot200_bl-use-devm_backlight_device_register.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Dec 3, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Subject: + backlight-ot200_bl-use-devm_backlight_device_register.patch added to -mm tree
To: [email protected],[email protected]
From: [email protected]
Date: Mon, 02 Dec 2013 17:00:34 -0800

The patch titled
Subject: backlight: ot200_bl: use devm_backlight_device_register()
has been added to the -mm tree. Its filename is
backlight-ot200_bl-use-devm_backlight_device_register.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/backlight-ot200_bl-use-devm_backlight_device_register.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/backlight-ot200_bl-use-devm_backlight_device_register.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Jingoo Han <[email protected]>
Subject: backlight: ot200_bl: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler.

---

 drivers/video/backlight/ot200_bl.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/video/backlight/ot200_bl.c renamed from drivers/video/backlight/ot200_bl.c~backlight-ot200_bl-use-devm_backlight_device_register +3 -5
diff -puN drivers/video/backlight/ot200_bl.c~backlight-ot200_bl-use-devm_backlight_device_register drivers/video/backlight/ot200_bl.c
@@ -118,8 +118,9 @@ static int ot200_backlight_probe(struct
 	props.brightness = 100;
 	props.type = BACKLIGHT_RAW;
 
-	bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, data,
-					&ot200_backlight_ops, &props);
+	bl = devm_backlight_device_register(&pdev->dev, dev_name(&pdev->dev),
+					&pdev->dev, data, &ot200_backlight_ops,
+					&props);
 	if (IS_ERR(bl)) {
 		dev_err(&pdev->dev, "failed to register backlight\n");
 		retval = PTR_ERR(bl);
@@ -137,10 +138,6 @@ error_devm_kzalloc:
 
 static int ot200_backlight_remove(struct platform_device *pdev)
 {
-	struct backlight_device *bl = platform_get_drvdata(pdev);
-
-	backlight_device_unregister(bl);