diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2013-05-10 04:16:54 -0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2013-06-12 14:39:06 -0400 |
commit | 3cc2d009bc210516c61536273b304c4f6ccd797c (patch) | |
tree | eb1dd301fbc62b9d33a027eb4e9c9f19dfacab81 | |
parent | e42dba569fceca5d59a88571370785e9ce9775b8 (diff) |
drivers/i2c/busses: 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.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r-- | drivers/i2c/busses/i2c-davinci.c | 8 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-designware-platdrv.c | 8 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-imx.c | 6 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-omap.c | 8 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-rcar.c | 7 |
5 files changed, 5 insertions, 32 deletions
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index cf20e06a88e1..fa556057d224 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c | |||
@@ -646,13 +646,6 @@ static int davinci_i2c_probe(struct platform_device *pdev) | |||
646 | struct resource *mem, *irq; | 646 | struct resource *mem, *irq; |
647 | int r; | 647 | int r; |
648 | 648 | ||
649 | /* NOTE: driver uses the static register mapping */ | ||
650 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
651 | if (!mem) { | ||
652 | dev_err(&pdev->dev, "no mem resource?\n"); | ||
653 | return -ENODEV; | ||
654 | } | ||
655 | |||
656 | irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 649 | irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
657 | if (!irq) { | 650 | if (!irq) { |
658 | dev_err(&pdev->dev, "no irq resource?\n"); | 651 | dev_err(&pdev->dev, "no irq resource?\n"); |
@@ -697,6 +690,7 @@ static int davinci_i2c_probe(struct platform_device *pdev) | |||
697 | return -ENODEV; | 690 | return -ENODEV; |
698 | clk_prepare_enable(dev->clk); | 691 | clk_prepare_enable(dev->clk); |
699 | 692 | ||
693 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
700 | dev->base = devm_ioremap_resource(&pdev->dev, mem); | 694 | dev->base = devm_ioremap_resource(&pdev->dev, mem); |
701 | if (IS_ERR(dev->base)) { | 695 | if (IS_ERR(dev->base)) { |
702 | r = PTR_ERR(dev->base); | 696 | r = PTR_ERR(dev->base); |
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 35b70a1edf57..ee46c92d7e3c 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c | |||
@@ -87,13 +87,6 @@ static int dw_i2c_probe(struct platform_device *pdev) | |||
87 | struct resource *mem; | 87 | struct resource *mem; |
88 | int irq, r; | 88 | int irq, r; |
89 | 89 | ||
90 | /* NOTE: driver uses the static register mapping */ | ||
91 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
92 | if (!mem) { | ||
93 | dev_err(&pdev->dev, "no mem resource?\n"); | ||
94 | return -EINVAL; | ||
95 | } | ||
96 | |||
97 | irq = platform_get_irq(pdev, 0); | 90 | irq = platform_get_irq(pdev, 0); |
98 | if (irq < 0) { | 91 | if (irq < 0) { |
99 | dev_err(&pdev->dev, "no irq resource?\n"); | 92 | dev_err(&pdev->dev, "no irq resource?\n"); |
@@ -104,6 +97,7 @@ static int dw_i2c_probe(struct platform_device *pdev) | |||
104 | if (!dev) | 97 | if (!dev) |
105 | return -ENOMEM; | 98 | return -ENOMEM; |
106 | 99 | ||
100 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
107 | dev->base = devm_ioremap_resource(&pdev->dev, mem); | 101 | dev->base = devm_ioremap_resource(&pdev->dev, mem); |
108 | if (IS_ERR(dev->base)) | 102 | if (IS_ERR(dev->base)) |
109 | return PTR_ERR(dev->base); | 103 | return PTR_ERR(dev->base); |
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 8c7526ca912e..6406aa960f2a 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c | |||
@@ -498,17 +498,13 @@ static int __init i2c_imx_probe(struct platform_device *pdev) | |||
498 | 498 | ||
499 | dev_dbg(&pdev->dev, "<%s>\n", __func__); | 499 | dev_dbg(&pdev->dev, "<%s>\n", __func__); |
500 | 500 | ||
501 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
502 | if (!res) { | ||
503 | dev_err(&pdev->dev, "can't get device resources\n"); | ||
504 | return -ENOENT; | ||
505 | } | ||
506 | irq = platform_get_irq(pdev, 0); | 501 | irq = platform_get_irq(pdev, 0); |
507 | if (irq < 0) { | 502 | if (irq < 0) { |
508 | dev_err(&pdev->dev, "can't get irq number\n"); | 503 | dev_err(&pdev->dev, "can't get irq number\n"); |
509 | return -ENOENT; | 504 | return -ENOENT; |
510 | } | 505 | } |
511 | 506 | ||
507 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
512 | base = devm_ioremap_resource(&pdev->dev, res); | 508 | base = devm_ioremap_resource(&pdev->dev, res); |
513 | if (IS_ERR(base)) | 509 | if (IS_ERR(base)) |
514 | return PTR_ERR(base); | 510 | return PTR_ERR(base); |
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index e02f9e36a7b2..352f3c38d1f7 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
@@ -1084,13 +1084,6 @@ omap_i2c_probe(struct platform_device *pdev) | |||
1084 | u32 rev; | 1084 | u32 rev; |
1085 | u16 minor, major, scheme; | 1085 | u16 minor, major, scheme; |
1086 | 1086 | ||
1087 | /* NOTE: driver uses the static register mapping */ | ||
1088 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
1089 | if (!mem) { | ||
1090 | dev_err(&pdev->dev, "no mem resource?\n"); | ||
1091 | return -ENODEV; | ||
1092 | } | ||
1093 | |||
1094 | irq = platform_get_irq(pdev, 0); | 1087 | irq = platform_get_irq(pdev, 0); |
1095 | if (irq < 0) { | 1088 | if (irq < 0) { |
1096 | dev_err(&pdev->dev, "no irq resource?\n"); | 1089 | dev_err(&pdev->dev, "no irq resource?\n"); |
@@ -1103,6 +1096,7 @@ omap_i2c_probe(struct platform_device *pdev) | |||
1103 | return -ENOMEM; | 1096 | return -ENOMEM; |
1104 | } | 1097 | } |
1105 | 1098 | ||
1099 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
1106 | dev->base = devm_ioremap_resource(&pdev->dev, mem); | 1100 | dev->base = devm_ioremap_resource(&pdev->dev, mem); |
1107 | if (IS_ERR(dev->base)) | 1101 | if (IS_ERR(dev->base)) |
1108 | return PTR_ERR(dev->base); | 1102 | return PTR_ERR(dev->base); |
diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index 4ba4a95b6b26..0fc585861610 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c | |||
@@ -623,12 +623,6 @@ static int rcar_i2c_probe(struct platform_device *pdev) | |||
623 | u32 bus_speed; | 623 | u32 bus_speed; |
624 | int ret; | 624 | int ret; |
625 | 625 | ||
626 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
627 | if (!res) { | ||
628 | dev_err(dev, "no mmio resources\n"); | ||
629 | return -ENODEV; | ||
630 | } | ||
631 | |||
632 | priv = devm_kzalloc(dev, sizeof(struct rcar_i2c_priv), GFP_KERNEL); | 626 | priv = devm_kzalloc(dev, sizeof(struct rcar_i2c_priv), GFP_KERNEL); |
633 | if (!priv) { | 627 | if (!priv) { |
634 | dev_err(dev, "no mem for private data\n"); | 628 | dev_err(dev, "no mem for private data\n"); |
@@ -642,6 +636,7 @@ static int rcar_i2c_probe(struct platform_device *pdev) | |||
642 | if (ret < 0) | 636 | if (ret < 0) |
643 | return ret; | 637 | return ret; |
644 | 638 | ||
639 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
645 | priv->io = devm_ioremap_resource(dev, res); | 640 | priv->io = devm_ioremap_resource(dev, res); |
646 | if (IS_ERR(priv->io)) | 641 | if (IS_ERR(priv->io)) |
647 | return PTR_ERR(priv->io); | 642 | return PTR_ERR(priv->io); |