Re: [PATCH 2/2] drivres/power/jz4740-battery.c: Use devm_request_and_ioremap

From: Lars-Peter Clausen
Date: Fri Nov 09 2012 - 04:42:06 EST


On 11/07/2012 12:11 AM, Marcos Paulo de Souza wrote:
> No functional changes. Just a cleanup.
>
> Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@xxxxxxxxx>

Looks good to me:

Acked-by: Lars-Peter Clausen <lars@xxxxxxxxxx>

One minor comment though:

> ---
> drivers/power/jz4740-battery.c | 33 +++++++--------------------------
> 1 file changed, 7 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/power/jz4740-battery.c b/drivers/power/jz4740-battery.c
> index 59900c6..e4ec7eb 100644
> --- a/drivers/power/jz4740-battery.c
> +++ b/drivers/power/jz4740-battery.c
>[...]
> - jz_battery->base = ioremap_nocache(jz_battery->mem->start,
> - resource_size(jz_battery->mem));
> + jz_battery->base = devm_request_and_ioremap(&pdev->dev, mem);
> if (!jz_battery->base) {
> - ret = -EBUSY;
> - dev_err(&pdev->dev, "Failed to ioremap mmio memory\n");
> - goto err_release_mem_region;
> + dev_err(&pdev->dev, "Failed to request/ioremap mmio memory\n");

devm_request_and_ioremap will print its own error messages if it fails, so
strictly speaking this is not necessary, but I don't think it is worth doing
resend just for this.

Anton, maybe you can just remove the line when applying the patch.

Thanks,
- Lars

> + return -EBUSY;
> }
>
[...]

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/