linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Thierry Reding <thierry.reding@avionic-design.de>,
	linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Wolfram Sang <w.sang@pengutronix.de>,
	spi-devel-general@lists.sourceforge.net
Subject: Re: [PATCH 25/33] spi: Convert to devm_ioremap_resource()
Date: Tue, 05 Feb 2013 14:20:24 +0000	[thread overview]
Message-ID: <20130205142024.79E733E1265@localhost> (raw)
In-Reply-To: <1358762966-20791-26-git-send-email-thierry.reding@avionic-design.de>

On Mon, 21 Jan 2013 11:09:18 +0100, Thierry Reding <thierry.reding@avionic-design.de> wrote:
> Convert all uses of devm_request_and_ioremap() to the newly introduced
> devm_ioremap_resource() 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: Thierry Reding <thierry.reding@avionic-design.de>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: spi-devel-general@lists.sourceforge.net

Looks fine by me. Go ahead and merge with the rest of the series.

Acked-by: Grant Likely <grant.likely@secretlab.ca>

> ---
>  drivers/spi/spi-ep93xx.c         | 7 +++----
>  drivers/spi/spi-mxs.c            | 6 +++---
>  drivers/spi/spi-omap2-mcspi.c    | 7 +++----
>  drivers/spi/spi-s3c64xx.c        | 7 +++----
>  drivers/spi/spi-sirf.c           | 7 +++----
>  drivers/spi/spi-tegra20-sflash.c | 8 +++-----
>  drivers/spi/spi-tegra20-slink.c  | 8 +++-----
>  7 files changed, 21 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
> index acb1e19..2e31f32 100644
> --- a/drivers/spi/spi-ep93xx.c
> +++ b/drivers/spi/spi-ep93xx.c
> @@ -1085,10 +1085,9 @@ static int ep93xx_spi_probe(struct platform_device *pdev)
>  
>  	espi->sspdr_phys = res->start + SSPDR;
>  
> -	espi->regs_base = devm_request_and_ioremap(&pdev->dev, res);
> -	if (!espi->regs_base) {
> -		dev_err(&pdev->dev, "failed to map resources\n");
> -		error = -ENODEV;
> +	espi->regs_base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(espi->regs_base)) {
> +		error = PTR_ERR(espi->regs_base);
>  		goto fail_put_clock;
>  	}
>  
> diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
> index a3ede24..b735988 100644
> --- a/drivers/spi/spi-mxs.c
> +++ b/drivers/spi/spi-mxs.c
> @@ -538,9 +538,9 @@ static int mxs_spi_probe(struct platform_device *pdev)
>  	if (!iores || irq_err < 0 || irq_dma < 0)
>  		return -EINVAL;
>  
> -	base = devm_request_and_ioremap(&pdev->dev, iores);
> -	if (!base)
> -		return -EADDRNOTAVAIL;
> +	base = devm_ioremap_resource(&pdev->dev, iores);
> +	if (IS_ERR(base))
> +		return PTR_ERR(base);
>  
>  	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
>  	if (IS_ERR(pinctrl))
> diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
> index b610f52..71a9482 100644
> --- a/drivers/spi/spi-omap2-mcspi.c
> +++ b/drivers/spi/spi-omap2-mcspi.c
> @@ -1204,10 +1204,9 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
>  	r->end += regs_offset;
>  	mcspi->phys = r->start;
>  
> -	mcspi->base = devm_request_and_ioremap(&pdev->dev, r);
> -	if (!mcspi->base) {
> -		dev_dbg(&pdev->dev, "can't ioremap MCSPI\n");
> -		status = -ENOMEM;
> +	mcspi->base = devm_ioremap_resource(&pdev->dev, r);
> +	if (IS_ERR(mcspi->base)) {
> +		status = PTR_ERR(mcspi->base);
>  		goto free_master;
>  	}
>  
> diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
> index ad93231..3d4a7c4 100644
> --- a/drivers/spi/spi-s3c64xx.c
> +++ b/drivers/spi/spi-s3c64xx.c
> @@ -1276,10 +1276,9 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
>  	/* the spi->mode bits understood by this driver: */
>  	master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
>  
> -	sdd->regs = devm_request_and_ioremap(&pdev->dev, mem_res);
> -	if (sdd->regs == NULL) {
> -		dev_err(&pdev->dev, "Unable to remap IO\n");
> -		ret = -ENXIO;
> +	sdd->regs = devm_ioremap_resource(&pdev->dev, mem_res);
> +	if (IS_ERR(sdd->regs)) {
> +		ret = PTR_ERR(sdd->regs);
>  		goto err1;
>  	}
>  
> diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
> index e0f43a5..78c8842 100644
> --- a/drivers/spi/spi-sirf.c
> +++ b/drivers/spi/spi-sirf.c
> @@ -535,10 +535,9 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> -	sspi->base = devm_request_and_ioremap(&pdev->dev, mem_res);
> -	if (!sspi->base) {
> -		dev_err(&pdev->dev, "IO remap failed!\n");
> -		ret = -ENOMEM;
> +	sspi->base = devm_ioremap_resource(&pdev->dev, mem_res);
> +	if (IS_ERR(sspi->base)) {
> +		ret = PTR_ERR(sspi->base);
>  		goto free_master;
>  	}
>  
> diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c
> index 448a8cc..69c9d23 100644
> --- a/drivers/spi/spi-tegra20-sflash.c
> +++ b/drivers/spi/spi-tegra20-sflash.c
> @@ -508,11 +508,9 @@ static int tegra_sflash_probe(struct platform_device *pdev)
>  		ret = -ENODEV;
>  		goto exit_free_master;
>  	}
> -	tsd->base = devm_request_and_ioremap(&pdev->dev, r);
> -	if (!tsd->base) {
> -		dev_err(&pdev->dev,
> -			"Cannot request memregion/iomap dma address\n");
> -		ret = -EADDRNOTAVAIL;
> +	tsd->base = devm_ioremap_resource(&pdev->dev, r);
> +	if (IS_ERR(tsd->base)) {
> +		ret = PTR_ERR(tsd->base);
>  		goto exit_free_master;
>  	}
>  
> diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
> index 651167f..96bd6c2 100644
> --- a/drivers/spi/spi-tegra20-slink.c
> +++ b/drivers/spi/spi-tegra20-slink.c
> @@ -1172,11 +1172,9 @@ static int tegra_slink_probe(struct platform_device *pdev)
>  		goto exit_free_master;
>  	}
>  	tspi->phys = r->start;
> -	tspi->base = devm_request_and_ioremap(&pdev->dev, r);
> -	if (!tspi->base) {
> -		dev_err(&pdev->dev,
> -			"Cannot request memregion/iomap dma address\n");
> -		ret = -EADDRNOTAVAIL;
> +	tspi->base = devm_ioremap_resource(&pdev->dev, r);
> +	if (IS_ERR(tspi->base)) {
> +		ret = PTR_ERR(tspi->base);
>  		goto exit_free_master;
>  	}
>  
> -- 
> 1.8.1.1
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.

  reply	other threads:[~2013-02-05 14:20 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-21 10:08 [PATCH 00/33] Sanitize devm_request_and_ioremap() Thierry Reding
2013-01-21 10:08 ` [PATCH 01/33] lib: devres: Introduce devm_ioremap_resource() Thierry Reding
2013-01-21 10:26   ` Dmitry Torokhov
2013-01-22 17:40   ` Greg Kroah-Hartman
2013-01-22 21:00     ` Thierry Reding
2013-01-21 10:08 ` [PATCH 02/33] ARM: Convert to devm_ioremap_resource() Thierry Reding
2013-01-21 15:58   ` Russell King - ARM Linux
2013-01-21 16:05     ` Thierry Reding
2013-01-21 16:16       ` Russell King - ARM Linux
2013-01-21 17:23         ` Arnd Bergmann
2013-01-22 17:37         ` Greg Kroah-Hartman
2013-01-21 10:08 ` [PATCH 03/33] MIPS: " Thierry Reding
2013-01-21 10:08 ` [PATCH 04/33] amba: " Thierry Reding
2013-01-21 10:08 ` [PATCH 05/33] ata: " Thierry Reding
2013-01-21 10:08 ` [PATCH 06/33] char: " Thierry Reding
2013-01-21 10:09 ` [PATCH 07/33] dma: " Thierry Reding
2013-01-28 16:00   ` Vinod Koul
2013-01-28 17:20     ` Thierry Reding
2013-01-29 13:11   ` Andy Shevchenko
2013-01-29 13:21     ` Greg Kroah-Hartman
2013-01-21 10:09 ` [PATCH 08/33] gpio: " Thierry Reding
2013-01-21 10:52   ` Viresh Kumar
2013-02-09 13:52     ` Grant Likely
2013-02-11 13:53       ` Linus Walleij
2013-02-11 15:07         ` Russell King - ARM Linux
2013-01-22 10:15   ` Linus Walleij
2013-01-22 10:25     ` Thierry Reding
2013-01-22 16:08       ` Greg Kroah-Hartman
2013-01-22 16:15         ` Thierry Reding
2013-01-23  8:36       ` Linus Walleij
2013-01-22 11:39     ` Gregory CLEMENT
2013-01-22 11:49       ` Thierry Reding
2013-01-21 10:09 ` [PATCH 09/33] drm: " Thierry Reding
2013-01-21 10:09 ` [PATCH 10/33] i2c: " Thierry Reding
2013-01-22 22:30   ` Wolfram Sang
2013-01-21 10:09 ` [PATCH 11/33] iio: " Thierry Reding
2013-01-22 12:12   ` Jonathan Cameron
2013-01-21 10:09 ` [PATCH 12/33] Input: " Thierry Reding
2013-01-21 10:27   ` Dmitry Torokhov
2013-01-21 10:45   ` Viresh Kumar
2013-01-21 10:49     ` Thierry Reding
2013-01-21 10:57       ` Viresh Kumar
2013-01-21 11:00         ` Thierry Reding
2013-01-21 10:09 ` [PATCH 13/33] iommu: " Thierry Reding
2013-01-21 10:09 ` [PATCH 14/33] media: " Thierry Reding
2013-01-22 11:04   ` Sylwester Nawrocki
2013-01-21 10:09 ` [PATCH 15/33] memory: " Thierry Reding
2013-01-21 10:09 ` [PATCH 16/33] mfd: " Thierry Reding
2013-02-03 17:22   ` Samuel Ortiz
2013-02-03 22:32     ` Samuel Ortiz
2013-01-21 10:09 ` [PATCH 17/33] misc: " Thierry Reding
2013-01-21 10:09 ` [PATCH 18/33] mmc: " Thierry Reding
2013-01-21 10:09 ` [PATCH 19/33] mtd: " Thierry Reding
2013-01-21 10:09 ` [PATCH 20/33] net: " Thierry Reding
2013-01-21 20:29   ` David Miller
2013-01-22  6:56     ` Thierry Reding
2013-01-22 13:03       ` Arnd Bergmann
2013-01-22 13:09         ` Thierry Reding
2013-01-22 13:17           ` Arnd Bergmann
2013-01-22 19:08         ` David Miller
2013-01-22 18:58       ` David Miller
2013-01-21 10:09 ` [PATCH 21/33] pinctrl: " Thierry Reding
2013-01-21 10:50   ` Viresh Kumar
2013-01-21 10:09 ` [PATCH 22/33] power: " Thierry Reding
2013-01-21 10:09 ` [PATCH 23/33] pwm: " Thierry Reding
2013-01-21 10:49   ` Viresh Kumar
2013-01-21 10:09 ` [PATCH 24/33] rtc: " Thierry Reding
2013-01-21 10:50   ` Viresh Kumar
2013-01-21 10:09 ` [PATCH 25/33] spi: " Thierry Reding
2013-02-05 14:20   ` Grant Likely [this message]
2013-01-21 10:09 ` [PATCH 26/33] staging: " Thierry Reding
2013-01-21 10:09 ` [PATCH 27/33] thermal: " Thierry Reding
2013-01-21 10:09 ` [PATCH 28/33] serial: " Thierry Reding
2013-01-21 10:09 ` [PATCH 29/33] usb: " Thierry Reding
2013-01-21 17:16   ` Alan Stern
2013-01-21 18:50   ` Felipe Balbi
2013-01-21 10:09 ` [PATCH 30/33] video: " Thierry Reding
2013-01-22  4:17   ` Jingoo Han
2013-01-21 10:09 ` [PATCH 31/33] w1: " Thierry Reding
2013-01-21 10:27   ` Evgeniy Polyakov
2013-01-21 10:09 ` [PATCH 32/33] watchdog: " Thierry Reding
2013-01-21 10:09 ` [PATCH 33/33] ASoC: " Thierry Reding
2013-01-22  7:48   ` Mark Brown
2013-01-22  7:55     ` Thierry Reding
2013-01-22  8:01       ` Mark Brown
2013-02-09 13:58 ` [PATCH 00/33] Sanitize devm_request_and_ioremap() Grant Likely

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=20130205142024.79E733E1265@localhost \
    --to=grant.likely@secretlab.ca \
    --cc=arnd@arndb.de \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=thierry.reding@avionic-design.de \
    --cc=w.sang@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).