diff mbox

[1/3] mmc: dw: don't check resource with devm_ioremap_resource

Message ID 1370424252-31562-1-git-send-email-andriy.shevchenko@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andy Shevchenko June 5, 2013, 9:24 a.m. UTC
devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mmc/host/dw_mmc-pltfm.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Seungwon Jeon June 5, 2013, 2:01 p.m. UTC | #1
On 06/05/13 6:24 PM, Andy Shevchenko wrote:
> devm_ioremap_resource does sanity checks on the given resource. No need to
> duplicate this in the driver.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Looks good to me.
'dw_mmc'(instead of 'dw') as a prefix of subject is expected with other patches, though.
Specially, dw_mmc-pci is for PATCH 3/3.

Acked-by: Seungwon Jeon <tgih.jun@samsung.com>


--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andy Shevchenko June 5, 2013, 2:14 p.m. UTC | #2
On Wed, 2013-06-05 at 23:01 +0900, Seungwon Jeon wrote: 
> On 06/05/13 6:24 PM, Andy Shevchenko wrote:
> > devm_ioremap_resource does sanity checks on the given resource. No need to
> > duplicate this in the driver.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Looks good to me.
> 'dw_mmc'(instead of 'dw') as a prefix of subject is expected with other patches, though.
> Specially, dw_mmc-pci is for PATCH 3/3.

Shall I resubmit patches?
I think no-one can mess up with this, because we fortunately have only
one mmc designware driver there.


> Acked-by: Seungwon Jeon <tgih.jun@samsung.com>

Thanks for review.
Chris Ball June 27, 2013, 3:25 p.m. UTC | #3
Hi Andy,

On Wed, Jun 05 2013, Andy Shevchenko wrote:
> On Wed, 2013-06-05 at 23:01 +0900, Seungwon Jeon wrote: 
>> On 06/05/13 6:24 PM, Andy Shevchenko wrote:
>> > devm_ioremap_resource does sanity checks on the given resource. No need to
>> > duplicate this in the driver.
>> > 
>> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> 
>> Looks good to me.
>> 'dw_mmc'(instead of 'dw') as a prefix of subject is expected with other patches, though.
>> Specially, dw_mmc-pci is for PATCH 3/3.
>
> Shall I resubmit patches?
> I think no-one can mess up with this, because we fortunately have only
> one mmc designware driver there.

Thanks, I pushed all three patches to mmc-next for 3.11 and corrected
the titles.

- Chris.
diff mbox

Patch

diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c
index 37873f1..526abae 100644
--- a/drivers/mmc/host/dw_mmc-pltfm.c
+++ b/drivers/mmc/host/dw_mmc-pltfm.c
@@ -25,7 +25,7 @@ 
 #include "dw_mmc.h"
 
 int dw_mci_pltfm_register(struct platform_device *pdev,
-				const struct dw_mci_drv_data *drv_data)
+			  const struct dw_mci_drv_data *drv_data)
 {
 	struct dw_mci *host;
 	struct resource	*regs;
@@ -35,10 +35,6 @@  int dw_mci_pltfm_register(struct platform_device *pdev,
 	if (!host)
 		return -ENOMEM;
 
-	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!regs)
-		return -ENXIO;
-
 	host->irq = platform_get_irq(pdev, 0);
 	if (host->irq < 0)
 		return host->irq;
@@ -47,6 +43,8 @@  int dw_mci_pltfm_register(struct platform_device *pdev,
 	host->dev = &pdev->dev;
 	host->irq_flags = 0;
 	host->pdata = pdev->dev.platform_data;
+
+	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	host->regs = devm_ioremap_resource(&pdev->dev, regs);
 	if (IS_ERR(host->regs))
 		return PTR_ERR(host->regs);