[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1439925926-3174-1-git-send-email-bjorn.andersson@sonymobile.com>
Date: Tue, 18 Aug 2015 12:25:26 -0700
From: Bjorn Andersson <bjorn.andersson@...ymobile.com>
To: Bryan Wu <cooloney@...il.com>, Richard Purdie <rpurdie@...ys.net>,
Jacek Anaszewski <j.anaszewski@...sung.com>
CC: Linus Walleij <linus.walleij@...aro.org>,
<linux-leds@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH v2] leds: syscon: Correct check for syscon_node_to_regmap() errors
syscon_node_to_regmap() returns a regmap or an ERR_PTR().
Signed-off-by: Bjorn Andersson <bjorn.andersson@...ymobile.com>
---
Changes since v1:
- Propagate the error
drivers/leds/leds-syscon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/leds/leds-syscon.c b/drivers/leds/leds-syscon.c
index d1660b039812..b88900d721e4 100644
--- a/drivers/leds/leds-syscon.c
+++ b/drivers/leds/leds-syscon.c
@@ -83,9 +83,9 @@ static int syscon_led_probe(struct platform_device *pdev)
return -ENODEV;
}
map = syscon_node_to_regmap(parent->of_node);
- if (!map) {
+ if (IS_ERR(map)) {
dev_err(dev, "no regmap for syscon LED parent\n");
- return -ENODEV;
+ return PTR_ERR(map);
}
sled = devm_kzalloc(dev, sizeof(*sled), GFP_KERNEL);
--
1.8.2.2
--
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