RE: [PATCH v2 5/8] mmc: host: omap_hsmmc: trivial cleanups

2012-03-19 Thread Hebbar, Gururaja
On Fri, Mar 16, 2012 at 19:09:01, S, Venkatraman wrote:
 From: Felipe Balbi ba...@ti.com
 
 a bunch of non-functional cleanups to the omap_hsmmc
 driver.
 
 It basically decreases indentation level, drop unneeded

s/unneeded/unneeded. Better to use unnecessary

 dereferences and drop unneded accesses to the platform_device

Same as above

 structure.
 
 Signed-off-by: Felipe Balbi ba...@ti.com
 Signed-off-by: Venkatraman S svenk...@ti.com
 ---

..snip..
..snip..

  }
 -- 
 1.7.10.rc0.41.gfa678
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-mmc in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 


Regards, 
Gururaja
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 5/8] mmc: host: omap_hsmmc: trivial cleanups

2012-03-19 Thread S, Venkatraman
On Mon, Mar 19, 2012 at 11:27 AM, Hebbar, Gururaja
gururaja.heb...@ti.com wrote:
 On Fri, Mar 16, 2012 at 19:09:01, S, Venkatraman wrote:
 From: Felipe Balbi ba...@ti.com

 a bunch of non-functional cleanups to the omap_hsmmc
 driver.

 It basically decreases indentation level, drop unneeded

 s/unneeded/unneeded. Better to use unnecessary

 dereferences and drop unneded accesses to the platform_device

 Same as above

Thanks. Now updated as below (and pushed out to the same branch)..

From 7174f9a831a8fcd224bf6dc1c2895e40fa252e84 Mon Sep 17 00:00:00 2001
From: Felipe Balbi ba...@ti.com
Date: Wed, 14 Mar 2012 11:18:27 +0200
Subject: [PATCH] mmc: host: omap_hsmmc: trivial cleanups

a bunch of non-functional cleanups to the omap_hsmmc
driver.

It basically decreases indentation level, drop unneeded
dereferences and drop unnecessary accesses to the platform_device
structure.

Signed-off-by: Felipe Balbi ba...@ti.com
Signed-off-by: Venkatraman S svenk...@ti.com
---
 drivers/mmc/host/omap_hsmmc.c |  147 -
 1 file changed, 70 insertions(+), 77 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 925d2be..cafd879 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2055,30 +2055,28 @@ static int omap_hsmmc_remove(struct
platform_device *pdev)
struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
struct resource *res;

-   if (host) {
-   pm_runtime_get_sync(host-dev);
-   mmc_remove_host(host-mmc);
-   if (host-use_reg)
-   omap_hsmmc_reg_put(host);
-   if (host-pdata-cleanup)
-   host-pdata-cleanup(pdev-dev);
-   free_irq(host-irq, host);
-   if (mmc_slot(host).card_detect_irq)
-   free_irq(mmc_slot(host).card_detect_irq, host);
-
-   pm_runtime_put_sync(host-dev);
-   pm_runtime_disable(host-dev);
-   clk_put(host-fclk);
-   if (host-got_dbclk) {
-   clk_disable(host-dbclk);
-   clk_put(host-dbclk);
-   }
+   pm_runtime_get_sync(host-dev);
+   mmc_remove_host(host-mmc);
+   if (host-use_reg)
+   omap_hsmmc_reg_put(host);
+   if (host-pdata-cleanup)
+   host-pdata-cleanup(pdev-dev);
+   free_irq(host-irq, host);
+   if (mmc_slot(host).card_detect_irq)
+   free_irq(mmc_slot(host).card_detect_irq, host);

-   mmc_free_host(host-mmc);
-   iounmap(host-base);
-   omap_hsmmc_gpio_free(pdev-dev.platform_data);
+   pm_runtime_put_sync(host-dev);
+   pm_runtime_disable(host-dev);
+   clk_put(host-fclk);
+   if (host-got_dbclk) {
+   clk_disable(host-dbclk);
+   clk_put(host-dbclk);
}

+   mmc_free_host(host-mmc);
+   iounmap(host-base);
+   omap_hsmmc_gpio_free(pdev-dev.platform_data);
+
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res)
release_mem_region(res-start, resource_size(res));
@@ -2091,49 +2089,45 @@ static int omap_hsmmc_remove(struct
platform_device *pdev)
 static int omap_hsmmc_suspend(struct device *dev)
 {
int ret = 0;
-   struct platform_device *pdev = to_platform_device(dev);
-   struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
+   struct omap_hsmmc_host *host = dev_get_drvdata(dev);

-   if (host  host-suspended)
+   if (!host)
return 0;

-   if (host) {
-   pm_runtime_get_sync(host-dev);
-   host-suspended = 1;
-   if (host-pdata-suspend) {
-   ret = host-pdata-suspend(pdev-dev,
-   host-slot_id);
-   if (ret) {
-   dev_dbg(mmc_dev(host-mmc),
-   Unable to handle MMC board
-level suspend\n);
-   host-suspended = 0;
-   return ret;
-   }
-   }
-   ret = mmc_suspend_host(host-mmc);
+   if (host  host-suspended)
+   return 0;

+   pm_runtime_get_sync(host-dev);
+   host-suspended = 1;
+   if (host-pdata-suspend) {
+   ret = host-pdata-suspend(dev, host-slot_id);
if (ret) {
+   dev_dbg(dev, Unable to handle MMC board
+level suspend\n);
host-suspended = 0;
-   if (host-pdata-resume) {
-   ret = host-pdata-resume(pdev-dev,
- host-slot_id);
-   if (ret)
-   

[PATCH v2 5/8] mmc: host: omap_hsmmc: trivial cleanups

2012-03-16 Thread Venkatraman S
From: Felipe Balbi ba...@ti.com

a bunch of non-functional cleanups to the omap_hsmmc
driver.

It basically decreases indentation level, drop unneded
dereferences and drop unneded accesses to the platform_device
structure.

Signed-off-by: Felipe Balbi ba...@ti.com
Signed-off-by: Venkatraman S svenk...@ti.com
---
 drivers/mmc/host/omap_hsmmc.c |  147 -
 1 file changed, 70 insertions(+), 77 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 2822442..c16c552 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2036,30 +2036,28 @@ static int omap_hsmmc_remove(struct platform_device 
*pdev)
struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
struct resource *res;
 
-   if (host) {
-   pm_runtime_get_sync(host-dev);
-   mmc_remove_host(host-mmc);
-   if (host-use_reg)
-   omap_hsmmc_reg_put(host);
-   if (host-pdata-cleanup)
-   host-pdata-cleanup(pdev-dev);
-   free_irq(host-irq, host);
-   if (mmc_slot(host).card_detect_irq)
-   free_irq(mmc_slot(host).card_detect_irq, host);
-
-   pm_runtime_put_sync(host-dev);
-   pm_runtime_disable(host-dev);
-   clk_put(host-fclk);
-   if (host-got_dbclk) {
-   clk_disable(host-dbclk);
-   clk_put(host-dbclk);
-   }
+   pm_runtime_get_sync(host-dev);
+   mmc_remove_host(host-mmc);
+   if (host-use_reg)
+   omap_hsmmc_reg_put(host);
+   if (host-pdata-cleanup)
+   host-pdata-cleanup(pdev-dev);
+   free_irq(host-irq, host);
+   if (mmc_slot(host).card_detect_irq)
+   free_irq(mmc_slot(host).card_detect_irq, host);
 
-   mmc_free_host(host-mmc);
-   iounmap(host-base);
-   omap_hsmmc_gpio_free(pdev-dev.platform_data);
+   pm_runtime_put_sync(host-dev);
+   pm_runtime_disable(host-dev);
+   clk_put(host-fclk);
+   if (host-got_dbclk) {
+   clk_disable(host-dbclk);
+   clk_put(host-dbclk);
}
 
+   mmc_free_host(host-mmc);
+   iounmap(host-base);
+   omap_hsmmc_gpio_free(pdev-dev.platform_data);
+
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res)
release_mem_region(res-start, resource_size(res));
@@ -2072,49 +2070,45 @@ static int omap_hsmmc_remove(struct platform_device 
*pdev)
 static int omap_hsmmc_suspend(struct device *dev)
 {
int ret = 0;
-   struct platform_device *pdev = to_platform_device(dev);
-   struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
+   struct omap_hsmmc_host *host = dev_get_drvdata(dev);
 
-   if (host  host-suspended)
+   if (!host)
return 0;
 
-   if (host) {
-   pm_runtime_get_sync(host-dev);
-   host-suspended = 1;
-   if (host-pdata-suspend) {
-   ret = host-pdata-suspend(pdev-dev,
-   host-slot_id);
-   if (ret) {
-   dev_dbg(mmc_dev(host-mmc),
-   Unable to handle MMC board
-level suspend\n);
-   host-suspended = 0;
-   return ret;
-   }
-   }
-   ret = mmc_suspend_host(host-mmc);
+   if (host  host-suspended)
+   return 0;
 
+   pm_runtime_get_sync(host-dev);
+   host-suspended = 1;
+   if (host-pdata-suspend) {
+   ret = host-pdata-suspend(dev, host-slot_id);
if (ret) {
+   dev_dbg(dev, Unable to handle MMC board
+level suspend\n);
host-suspended = 0;
-   if (host-pdata-resume) {
-   ret = host-pdata-resume(pdev-dev,
- host-slot_id);
-   if (ret)
-   dev_dbg(mmc_dev(host-mmc),
-   Unmask interrupt failed\n);
-   }
-   goto err;
+   return ret;
}
+   }
+   ret = mmc_suspend_host(host-mmc);
 
-   if (!(host-mmc-pm_flags  MMC_PM_KEEP_POWER)) {
-   omap_hsmmc_disable_irq(host);
-   OMAP_HSMMC_WRITE(host-base, HCTL,
-   OMAP_HSMMC_READ(host-base, HCTL)  ~SDBP);
+   if (ret) {
+   host-suspended = 0;
+   if (host-pdata-resume) {
+   ret =