linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Aaron Wu <Aaron.wu@analog.com>,
	adi-buildroot-devel@lists.sourceforge.net, wg@grandegger.com,
	linux-can@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bfin_can: rewrite the blackfin CAN driver into arch independent style
Date: Wed, 07 Jan 2015 15:36:17 +0100	[thread overview]
Message-ID: <54AD4461.1040203@pengutronix.de> (raw)
In-Reply-To: <1419391828-21105-1-git-send-email-Aaron.wu@analog.com>

[-- Attachment #1: Type: text/plain, Size: 1851 bytes --]

On 12/24/2014 04:30 AM, Aaron Wu wrote:
> Rewrite the blackfin CAN driver into arch independent style
> 
> Signed-off-by: Aaron Wu <Aaron.wu@analog.com>

[...]

> @@ -547,6 +543,11 @@ static int bfin_can_probe(struct platform_device *pdev)
>  	}
>  
>  	res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (res_mem == NULL) {
> +		dev_err(&pdev->dev, "Cannot get IORESOURCE_MEM\n");
> +		return -ENOENT;
> +	}
> +
>  	rx_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
>  	tx_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
>  	err_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 2);
> @@ -555,12 +556,6 @@ static int bfin_can_probe(struct platform_device *pdev)
>  		goto exit;
>  	}
>  
> -	if (!request_mem_region(res_mem->start, resource_size(res_mem),
> -				dev_name(&pdev->dev))) {
> -		err = -EBUSY;
> -		goto exit;
> -	}

You should remove the corresponding release_mem_region() from the
remove() function, too.

> -
>  	/* request peripheral pins */
>  	err = peripheral_request_list(pdata, dev_name(&pdev->dev));
>  	if (err)
> @@ -573,7 +568,13 @@ static int bfin_can_probe(struct platform_device *pdev)
>  	}
>  
>  	priv = netdev_priv(dev);
> -	priv->membase = (void __iomem *)res_mem->start;
> +
> +	priv->membase = devm_ioremap_resource(&pdev->dev, res_mem);
> +	if (IS_ERR((void *)priv->membase)) {
> +		dev_err(&pdev->dev, "Cannot map IO\n");
> +		return PTR_ERR((void *)priv->membase);

Is this cast still needed?

Can you move the devm_ conversion into a separate patch?

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-01-07 14:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-24  3:30 [PATCH] bfin_can: rewrite the blackfin CAN driver into arch independent style Aaron Wu
2015-01-07 14:36 ` Marc Kleine-Budde [this message]
2015-01-08  7:13   ` Wu, Aaron
2015-01-08  8:28     ` Marc Kleine-Budde
2015-02-05  8:42   ` Wu, Aaron
2015-02-05  8:51     ` Marc Kleine-Budde

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=54AD4461.1040203@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=Aaron.wu@analog.com \
    --cc=adi-buildroot-devel@lists.sourceforge.net \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wg@grandegger.com \
    /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).