i2c-designware-platform: don't check resource with devm_ioremap_resource
Subsystems (3)
PATCH 1/1 i2c-designware-platform: don't check resource with devm_ioremap_resource
devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver.
--- drivers/i2c/busses/i2c-designware-platdrv.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/i2c/busses/i2c-designware-platdrv.c +1 -7
@@ -87,13 +87,6 @@ static int dw_i2c_probe(struct platform_device *pdev)struct resource *mem;int irq, r; -/* NOTE: driver uses the static register mapping */ - mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!mem) { -dev_err (&pdev->dev,"no mem resource?\n" ); -return -EINVAL ; - } - irq =platform_get_irq (pdev,0 );if (irq <0 ) {dev_err (&pdev->dev,"no irq resource?\n" );
@@ -104,6 +97,7 @@ static int dw_i2c_probe(struct platform_device *pdev)if (!dev)return -ENOMEM ; + mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); dev->base =devm_ioremap_resource (&pdev->dev, mem);if (IS_ERR (dev->base))return PTR_ERR (dev->base);
Signature · 1 line
1.8.2.rc0.22.gb3600c3
A message that is not in the archive (sent off-list or not yet received): 1370613449-29719-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/[email protected]
Quoted 4 lines · Andy Shevchenko
devm_ioremap_resourcedoes sanity checks on the given resource. No need to duplicate this in the driver.
Thanks, yet I applied my original patch which removes this pattern from the whole subsystem.