[PATCH] drivers/spi/spi-tegra114.c clean use of devm_ioremap_resource()

2013-05-14 Thread Laurent Navet
Check of 'r' and calls to dev_err are already done in devm_ioremap_resource,
so no need to do them twice.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/spi/spi-tegra114.c |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index 598eb45..18a6592 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -1059,18 +1059,12 @@ static int tegra_spi_probe(struct platform_device *pdev)
spin_lock_init(tspi-lock);
 
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!r) {
-   dev_err(pdev-dev, No IO memory resource\n);
-   ret = -ENODEV;
-   goto exit_free_master;
-   }
-   tspi-phys = r-start;
tspi-base = devm_ioremap_resource(pdev-dev, r);
if (IS_ERR(tspi-base)) {
ret = PTR_ERR(tspi-base);
-   dev_err(pdev-dev, ioremap failed: err = %d\n, ret);
goto exit_free_master;
}
+   tspi-phys = r-start;
 
spi_irq = platform_get_irq(pdev, 0);
tspi-irq = spi_irq;
-- 
1.7.10.4


--
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH] drivers/spi/spi-tegra114.c clean use of devm_ioremap_resource()

2013-05-14 Thread Stephen Warren
On 05/14/2013 04:07 AM, Laurent Navet wrote:
 Check of 'r' and calls to dev_err are already done in devm_ioremap_resource,
 so no need to do them twice.

I think this duplicates part of a much wider patch series that Wolfram
is working on; I CC'd him here.

--
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general