Re: [RFC 23/42] drivers/spi: don't check resource with devm_ioremap_resource

From: Stephen Warren
Date: Fri May 10 2013 - 12:37:52 EST


On 05/10/2013 02:17 AM, Wolfram Sang wrote:
> devm_ioremap_resource does sanity checks on the given resource. No need to
> duplicate this in the driver.

> diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c

> - 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;
> + r = platform_get_resource(pdev, IORESOURCE_MEM, 0);

The tspi->phy assignment is broken there now.

> diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c

> - 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;
> + r = platform_get_resource(pdev, IORESOURCE_MEM, 0);

Same here.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/