Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43926c27 authored by Wei Yongjun's avatar Wei Yongjun Committed by Jacek Anaszewski
Browse files

leds: sc27xx: Fix return value check in sc27xx_led_probe()



In case of error, the function dev_get_regmap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: e081c49e ("leds: Add Spreadtrum SC27xx breathing light controller driver")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarJacek Anaszewski <jacek.anaszewski@gmail.com>
parent e081c49e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -176,8 +176,8 @@ static int sc27xx_led_probe(struct platform_device *pdev)
	mutex_init(&priv->lock);
	priv->base = base;
	priv->regmap = dev_get_regmap(dev->parent, NULL);
	if (IS_ERR(priv->regmap)) {
		err = PTR_ERR(priv->regmap);
	if (!priv->regmap) {
		err = -ENODEV;
		dev_err(dev, "failed to get regmap: %d\n", err);
		return err;
	}