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

Commit 2e2d612d authored by Sachin Kamat's avatar Sachin Kamat Committed by Mauro Carvalho Chehab
Browse files

[media] soc_camera/sh_mobile_csi2: Convert to devm_ioremap_resource()



Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.
devm_ioremap_resource() provides its own error messages; so all explicit
error messages can be removed from the failure code paths.

Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 15a09342
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
 */

#include <linux/delay.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/io.h>
#include <linux/platform_device.h>
@@ -324,11 +325,9 @@ static int sh_csi2_probe(struct platform_device *pdev)

	priv->irq = irq;

	priv->base = devm_request_and_ioremap(&pdev->dev, res);
	if (!priv->base) {
		dev_err(&pdev->dev, "Unable to ioremap CSI2 registers.\n");
		return -ENXIO;
	}
	priv->base = devm_ioremap_resource(&pdev->dev, res);
	if (IS_ERR(priv->base))
		return PTR_ERR(priv->base);

	priv->pdev = pdev;
	platform_set_drvdata(pdev, priv);