public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: jg1.han@samsung•com (Jingoo Han)
To: linux-arm-kernel@lists•infradead.org
Subject: [RFC 23/42] drivers/spi: don't check resource with devm_ioremap_resource
Date: Sat, 11 May 2013 14:24:35 +0900	[thread overview]
Message-ID: <002b01ce4e07$d3087ed0$79197c70$@samsung.com> (raw)
In-Reply-To: <1368173847-5661-24-git-send-email-wsa@the-dreams.de>

On Friday, May 10, 2013 5:17 PM, Wolfram Sang wrote:
> 
> devm_ioremap_resource does sanity checks on the given resource. No need to
> duplicate this in the driver.
> 
> Signed-off-by: Wolfram Sang <wsa@the-dreams•de>
> ---
>  drivers/spi/spi-bcm63xx.c        |    8 +-------
>  drivers/spi/spi-ep93xx.c         |    8 +-------
>  drivers/spi/spi-omap2-mcspi.c    |    7 +------
>  drivers/spi/spi-s3c64xx.c        |    7 +------
>  drivers/spi/spi-sirf.c           |    7 +------
>  drivers/spi/spi-tegra114.c       |    7 +------
>  drivers/spi/spi-tegra20-sflash.c |    5 -----
>  drivers/spi/spi-tegra20-slink.c  |    7 +------
>  8 files changed, 7 insertions(+), 49 deletions(-)
> 

[.....]

> diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
> index 5000586..fd763cc 100644
> --- a/drivers/spi/spi-s3c64xx.c
> +++ b/drivers/spi/spi-s3c64xx.c
> @@ -1243,12 +1243,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
>  		return -ENODEV;
>  	}
> 
> -	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (mem_res == NULL) {
> -		dev_err(&pdev->dev, "Unable to get SPI MEM resource\n");
> -		return -ENXIO;
> -	}
> -

It breaks 'sdd->sfr_start' assignment as below:

1272         sdd->sfr_start = mem_res->start;


Best regards,
Jingoo Han

>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0) {
>  		dev_warn(&pdev->dev, "Failed to get IRQ: %d\n", irq);
> @@ -1318,6 +1312,7 @@ static int 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;
> 
> +	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	sdd->regs = devm_ioremap_resource(&pdev->dev, mem_res);
>  	if (IS_ERR(sdd->regs)) {
>  		ret = PTR_ERR(sdd->regs);

  parent reply	other threads:[~2013-05-11  5:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1368173847-5661-1-git-send-email-wsa@the-dreams.de>
     [not found] ` <1368173847-5661-19-git-send-email-wsa@the-dreams.de>
2013-05-10 14:30   ` [RFC 18/42] drivers/pinctrl: don't check resource with devm_ioremap_resource Jean-Christophe PLAGNIOL-VILLARD
2013-05-14 12:19   ` Linus Walleij
2013-06-06  8:43   ` Jean-Christophe PLAGNIOL-VILLARD
     [not found] ` <1368173847-5661-24-git-send-email-wsa@the-dreams.de>
2013-05-10 10:55   ` [RFC 23/42] drivers/spi: " Mark Brown
2013-05-10 16:37   ` Stephen Warren
2013-05-11  5:24   ` Jingoo Han [this message]
     [not found] ` <1368173847-5661-39-git-send-email-wsa@the-dreams.de>
2013-05-10 16:46   ` [RFC 38/42] arch/arm/plat-omap: " Tony Lindgren
     [not found] ` <1368173847-5661-40-git-send-email-wsa@the-dreams.de>
2013-05-11  5:15   ` [RFC 39/42] arch/arm/plat-samsung: " Jingoo Han
     [not found] ` <1368173847-5661-20-git-send-email-wsa@the-dreams.de>
2013-05-12 15:10   ` [RFC 19/42] drivers/pinctrl/spear: " Viresh Kumar
2013-05-14 12:56   ` Linus Walleij
     [not found] ` <1368173847-5661-23-git-send-email-wsa@the-dreams.de>
2013-05-12 15:11   ` [RFC 22/42] drivers/rtc: " Viresh Kumar
     [not found] ` <1368173847-5661-21-git-send-email-wsa@the-dreams.de>
2013-05-12 15:12   ` [RFC 20/42] drivers/pwm: " Viresh Kumar
     [not found] ` <1368173847-5661-10-git-send-email-wsa@the-dreams.de>
2013-05-11  5:18   ` [RFC 09/42] drivers/i2c/busses: " Jingoo Han
2013-06-04 18:34   ` Kevin Hilman

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='002b01ce4e07$d3087ed0$79197c70$@samsung.com' \
    --to=jg1.han@samsung$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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