linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pata_arasan_cf: remove bogus to_platform_device() calls
@ 2011-10-12 15:09 Sergei Shtylyov
  2011-10-13  3:33 ` Viresh Kumar
  0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2011-10-12 15:09 UTC (permalink / raw)
  To: linux-ide, jgarzik, viresh.kumar

The suspend()/resume() methods already get the right 'struct device' to get the
driver data from -- there's no need to get to the 'struct platform_device' that
contains that 'struct device' just to call dev_get_drvdata()...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

---
This patch is against the recent Linus' tree.

 drivers/ata/pata_arasan_cf.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Index: linux-2.6/drivers/ata/pata_arasan_cf.c
===================================================================
--- linux-2.6.orig/drivers/ata/pata_arasan_cf.c
+++ linux-2.6/drivers/ata/pata_arasan_cf.c
@@ -922,8 +922,7 @@ static int __devexit arasan_cf_remove(st
 #ifdef CONFIG_PM
 static int arasan_cf_suspend(struct device *dev)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct ata_host *host = dev_get_drvdata(&pdev->dev);
+	struct ata_host *host = dev_get_drvdata(dev);
 	struct arasan_cf_dev *acdev = host->ports[0]->private_data;
 
 	if (acdev->dma_chan) {
@@ -937,8 +936,7 @@ static int arasan_cf_suspend(struct devi
 
 static int arasan_cf_resume(struct device *dev)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct ata_host *host = dev_get_drvdata(&pdev->dev);
+	struct ata_host *host = dev_get_drvdata(dev);
 	struct arasan_cf_dev *acdev = host->ports[0]->private_data;
 
 	cf_init(acdev);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] pata_arasan_cf: remove bogus to_platform_device() calls
  2011-10-12 15:09 [PATCH] pata_arasan_cf: remove bogus to_platform_device() calls Sergei Shtylyov
@ 2011-10-13  3:33 ` Viresh Kumar
  0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2011-10-13  3:33 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: linux-ide@vger.kernel.org, jgarzik@pobox.com, Shiraz HASHIM

On 10/12/2011 8:39 PM, Sergei Shtylyov wrote:
> The suspend()/resume() methods already get the right 'struct device' to get the
> driver data from -- there's no need to get to the 'struct platform_device' that
> contains that 'struct device' just to call dev_get_drvdata()...
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> 
> ---
> This patch is against the recent Linus' tree.
> 
>  drivers/ata/pata_arasan_cf.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> Index: linux-2.6/drivers/ata/pata_arasan_cf.c
> ===================================================================
> --- linux-2.6.orig/drivers/ata/pata_arasan_cf.c
> +++ linux-2.6/drivers/ata/pata_arasan_cf.c
> @@ -922,8 +922,7 @@ static int __devexit arasan_cf_remove(st
>  #ifdef CONFIG_PM
>  static int arasan_cf_suspend(struct device *dev)
>  {
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct ata_host *host = dev_get_drvdata(&pdev->dev);
> +	struct ata_host *host = dev_get_drvdata(dev);
>  	struct arasan_cf_dev *acdev = host->ports[0]->private_data;
>  
>  	if (acdev->dma_chan) {
> @@ -937,8 +936,7 @@ static int arasan_cf_suspend(struct devi
>  
>  static int arasan_cf_resume(struct device *dev)
>  {
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct ata_host *host = dev_get_drvdata(&pdev->dev);
> +	struct ata_host *host = dev_get_drvdata(dev);
>  	struct arasan_cf_dev *acdev = host->ports[0]->private_data;
>  
>  	cf_init(acdev);
> .
> 

Acked-by: Viresh Kumar <viresh.kumar@st.com>

-- 
viresh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-13  3:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-12 15:09 [PATCH] pata_arasan_cf: remove bogus to_platform_device() calls Sergei Shtylyov
2011-10-13  3:33 ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).