From db9e2190a49618d9b23f6e290e62a2c90d45a681 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 3 Aug 2011 10:52:41 +1000 Subject: [PATCH] backlight_device_register() returns ERR_PTR() on error. Signed-off-by: Axel Lin Cc: Richard Purdie Cc: Jin Park Cc: Samuel Ortiz Signed-off-by: Andrew Morton --- drivers/video/backlight/aat2870_bl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/aat2870_bl.c b/drivers/video/backlight/aat2870_bl.c index 4952a617563d..f13a3f7e2e8f 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; } -- 2.39.2