linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: ata: rcar: use devm_ioremap_resource()
@ 2013-04-12  6:51 Silviu-Mihai Popescu
  2013-04-12 10:23 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Silviu-Mihai Popescu @ 2013-04-12  6:51 UTC (permalink / raw)
  To: linux-ide; +Cc: Jeff Garzik, linux-kernel, Silviu-Mihai Popescu

Convert  use of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.
This was found with coccinelle.

Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
---
 drivers/ata/sata_rcar.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index caf33f6..8c51a3a 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -799,9 +799,9 @@ static int sata_rcar_probe(struct platform_device *pdev)
 
 	host->private_data = priv;
 
-	priv->base = devm_request_and_ioremap(&pdev->dev, mem);
-	if (!priv->base) {
-		ret = -EADDRNOTAVAIL;
+	priv->base = devm_ioremap_resource(&pdev->dev, mem);
+	if (IS_ERR(priv->base)) {
+		ret = PTR_ERR(priv->base);
 		goto cleanup;
 	}
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers: ata: rcar: use devm_ioremap_resource()
  2013-04-12  6:51 [PATCH] drivers: ata: rcar: use devm_ioremap_resource() Silviu-Mihai Popescu
@ 2013-04-12 10:23 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2013-04-12 10:23 UTC (permalink / raw)
  To: Silviu-Mihai Popescu; +Cc: linux-ide, linux-kernel

On 04/12/2013 02:51 AM, Silviu-Mihai Popescu wrote:
> Convert  use of devm_request_and_ioremap() to the newly introduced
> devm_ioremap_resource() which provides more consistent error handling.
> This was found with coccinelle.
>
> Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
> ---
>   drivers/ata/sata_rcar.c |    6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
> index caf33f6..8c51a3a 100644
> --- a/drivers/ata/sata_rcar.c
> +++ b/drivers/ata/sata_rcar.c
> @@ -799,9 +799,9 @@ static int sata_rcar_probe(struct platform_device *pdev)
>
>   	host->private_data = priv;
>
> -	priv->base = devm_request_and_ioremap(&pdev->dev, mem);
> -	if (!priv->base) {
> -		ret = -EADDRNOTAVAIL;
> +	priv->base = devm_ioremap_resource(&pdev->dev, mem);
> +	if (IS_ERR(priv->base)) {
> +		ret = PTR_ERR(priv->base);
>   		goto cleanup;
>   	}
>
>

See 2de1d5e159ccf317a9285a0dfaa6e4262500d7dd in libata-dev.git#upstream.

	Jeff





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-12 10:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-12  6:51 [PATCH] drivers: ata: rcar: use devm_ioremap_resource() Silviu-Mihai Popescu
2013-04-12 10:23 ` Jeff Garzik

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).