From: Thierry Reding Date: Mon, 21 Jan 2013 10:09:15 +0000 (+0100) Subject: power: Convert to devm_ioremap_resource() X-Git-Tag: v3.9-rc1~128^2~14 X-Git-Url: http://git.cascardo.info/?a=commitdiff_plain;h=e2cbdf3cb72571f1231cd7c3cb14009f9b8df707;p=cascardo%2Flinux.git power: Convert to devm_ioremap_resource() Convert all uses of devm_request_and_ioremap() to the newly introduced devm_ioremap_resource() which provides more consistent error handling. Signed-off-by: Thierry Reding Cc: Anton Vorontsov Cc: David Woodhouse Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/power/jz4740-battery.c b/drivers/power/jz4740-battery.c index bf914893c6fd..c675553d4647 100644 --- a/drivers/power/jz4740-battery.c +++ b/drivers/power/jz4740-battery.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -266,9 +267,9 @@ static int jz_battery_probe(struct platform_device *pdev) mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - jz_battery->base = devm_request_and_ioremap(&pdev->dev, mem); - if (!jz_battery->base) - return -EBUSY; + jz_battery->base = devm_ioremap_resource(&pdev->dev, mem); + if (IS_ERR(jz_battery->base)) + return PTR_ERR(jz_battery->base); battery = &jz_battery->battery; battery->name = pdata->info.name;