All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Ben Dooks <ben.dooks@codethink.co.uk>, linux-mmc@vger.kernel.org
Cc: linux-sh@vger.kernel.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Chris Ball <chris@printf.net>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	magnus.damm@opensource.se, linux-kernel@lists.codethink.co.uk
Subject: Re: [PATCH 2/6] mmc: sh-mmcif: use devm_ for ioremap
Date: Tue, 01 Apr 2014 15:26:07 +0400	[thread overview]
Message-ID: <533AA24F.8050705@cogentembedded.com> (raw)
In-Reply-To: <1396347954-13740-3-git-send-email-ben.dooks@codethink.co.uk>

Hello.

On 01-04-2014 14:25, Ben Dooks wrote:

> Start tidying the probe/release code by using devm_ioremap_resource() to
> map the IO registers.

> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
>   drivers/mmc/host/sh_mmcif.c | 20 +++++---------------
>   1 file changed, 5 insertions(+), 15 deletions(-)

> diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> index c48df98..be6be2b 100644
> --- a/drivers/mmc/host/sh_mmcif.c
> +++ b/drivers/mmc/host/sh_mmcif.c
> @@ -1379,22 +1379,17 @@ static int sh_mmcif_probe(struct platform_device *pdev)
>   		dev_err(&pdev->dev, "Get irq error\n");
>   		return -ENXIO;
>   	}
> +
>   	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		dev_err(&pdev->dev, "platform_get_resource error.\n");
> -		return -ENXIO;
> -	}
> -	reg = ioremap(res->start, resource_size(res));
> -	if (!reg) {
> +	reg = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(reg)) {
>   		dev_err(&pdev->dev, "ioremap error.\n");
>   		return -ENOMEM;

    Should propagate devm_ioremap_resource() error instead.

[...]

WBR, Sergei


WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Ben Dooks <ben.dooks@codethink.co.uk>, linux-mmc@vger.kernel.org
Cc: linux-sh@vger.kernel.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Chris Ball <chris@printf.net>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	magnus.damm@opensource.se, linux-kernel@lists.codethink.co.uk
Subject: Re: [PATCH 2/6] mmc: sh-mmcif: use devm_ for ioremap
Date: Tue, 01 Apr 2014 11:26:07 +0000	[thread overview]
Message-ID: <533AA24F.8050705@cogentembedded.com> (raw)
In-Reply-To: <1396347954-13740-3-git-send-email-ben.dooks@codethink.co.uk>

Hello.

On 01-04-2014 14:25, Ben Dooks wrote:

> Start tidying the probe/release code by using devm_ioremap_resource() to
> map the IO registers.

> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
>   drivers/mmc/host/sh_mmcif.c | 20 +++++---------------
>   1 file changed, 5 insertions(+), 15 deletions(-)

> diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> index c48df98..be6be2b 100644
> --- a/drivers/mmc/host/sh_mmcif.c
> +++ b/drivers/mmc/host/sh_mmcif.c
> @@ -1379,22 +1379,17 @@ static int sh_mmcif_probe(struct platform_device *pdev)
>   		dev_err(&pdev->dev, "Get irq error\n");
>   		return -ENXIO;
>   	}
> +
>   	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		dev_err(&pdev->dev, "platform_get_resource error.\n");
> -		return -ENXIO;
> -	}
> -	reg = ioremap(res->start, resource_size(res));
> -	if (!reg) {
> +	reg = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(reg)) {
>   		dev_err(&pdev->dev, "ioremap error.\n");
>   		return -ENOMEM;

    Should propagate devm_ioremap_resource() error instead.

[...]

WBR, Sergei


  parent reply	other threads:[~2014-04-01 11:26 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01 10:25 cleanups for sh-mmcif driver Ben Dooks
2014-04-01 10:25 ` Ben Dooks
2014-04-01 10:25 ` [PATCH 1/6] mmc: sh-mmcif: print bus clock rate on probe Ben Dooks
2014-04-01 10:25   ` Ben Dooks
2014-04-01 10:45   ` Geert Uytterhoeven
2014-04-01 10:45     ` Geert Uytterhoeven
2014-04-01 11:08   ` Laurent Pinchart
2014-04-01 11:08     ` Laurent Pinchart
2014-04-01 11:37     ` Ben Dooks
2014-04-01 11:37       ` Ben Dooks
2014-04-01 10:25 ` [PATCH 2/6] mmc: sh-mmcif: use devm_ for ioremap Ben Dooks
2014-04-01 10:25   ` Ben Dooks
2014-04-01 10:55   ` Geert Uytterhoeven
2014-04-01 10:55     ` Geert Uytterhoeven
2014-04-01 10:59     ` Ben Dooks
2014-04-01 10:59       ` Ben Dooks
2014-04-01 11:08   ` Laurent Pinchart
2014-04-01 11:08     ` Laurent Pinchart
2014-04-01 11:26   ` Sergei Shtylyov [this message]
2014-04-01 11:26     ` Sergei Shtylyov
2014-04-01 10:25 ` [PATCH 3/6] mmc: sh-mmcif: use devm_ for clock management Ben Dooks
2014-04-01 10:25   ` Ben Dooks
2014-04-01 10:59   ` Geert Uytterhoeven
2014-04-01 10:59     ` Geert Uytterhoeven
2014-04-01 11:25     ` Ben Dooks
2014-04-01 11:25       ` Ben Dooks
2014-04-01 10:25 ` [PATCH 4/6] mmc: sh-mmcif: use devm_ for irq management Ben Dooks
2014-04-01 10:25   ` Ben Dooks
2014-04-01 10:25 ` [PATCH 5/6] mmc: sh-mmcif: no need to call pm_runtime_suspend on error Ben Dooks
2014-04-01 10:25   ` Ben Dooks
2014-04-01 10:25 ` [PATCH 6/6] mmc: sh-mmcif: final error path cleanup Ben Dooks
2014-04-01 10:25   ` Ben Dooks
  -- strict thread matches above, loose matches on Subject: below --
2014-06-04 11:42 resend - sh mmcif driver cleanup patch series Ben Dooks
2014-06-04 11:42 ` [PATCH 2/6] mmc: sh-mmcif: use devm_ for ioremap Ben Dooks
2014-06-04 12:58   ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=533AA24F.8050705@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=ben.dooks@codethink.co.uk \
    --cc=chris@printf.net \
    --cc=g.liakhovetski@gmx.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@lists.codethink.co.uk \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@opensource.se \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.