[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1309931940.6088.1.camel@phoenix>
Date: Wed, 06 Jul 2011 13:59:00 +0800
From: Axel Lin <axel.lin@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Richard Purdie <rpurdie@...ys.net>,
Jin Park <jinyoungp@...dia.com>,
Samuel Ortiz <sameo@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH] backlight: aat2870_bl: fix error checking for
backlight_device_register
backlight_device_register() returns ERR_PTR() on error.
Signed-off-by: Axel Lin <axel.lin@...il.com>
---
drivers/video/backlight/aat2870_bl.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/backlight/aat2870_bl.c b/drivers/video/backlight/aat2870_bl.c
index 4952a61..f13a3f7 100644
--- a/drivers/video/backlight/aat2870_bl.c
+++ b/drivers/video/backlight/aat2870_bl.c
@@ -158,10 +158,10 @@ static int aat2870_bl_probe(struct platform_device *pdev)
props.type = BACKLIGHT_RAW;
bd = backlight_device_register("aat2870-backlight", &pdev->dev,
aat2870_bl, &aat2870_bl_ops, &props);
- if (!bd) {
+ if (IS_ERR(bd)) {
dev_err(&pdev->dev,
"Failed allocate memory for backlight device\n");
- ret = -ENOMEM;
+ ret = PTR_ERR(bd);
goto out_kfree;
}
--
1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists