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

Commit 24bb3813 authored by Jingoo Han's avatar Jingoo Han Committed by Linus Walleij
Browse files

gpio: adp5520: use devm_kzalloc()



Use devm_kzalloc() to make cleanup paths simpler.

Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 808c513e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ static int adp5520_gpio_probe(struct platform_device *pdev)
		return -ENODEV;
	}

	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
	if (dev == NULL) {
		dev_err(&pdev->dev, "failed to alloc memory\n");
		return -ENOMEM;
@@ -163,7 +163,6 @@ static int adp5520_gpio_probe(struct platform_device *pdev)
	return 0;

err:
	kfree(dev);
	return ret;
}

@@ -180,7 +179,6 @@ static int adp5520_gpio_remove(struct platform_device *pdev)
		return ret;
	}

	kfree(dev);
	return 0;
}