Skip to contentSkip to conversation

pata_arasan_cf: remove bogus to_platform_device() calls

PATCH In review Sergei Shtylyov 2 participants 2 messages Oct 12, 2011 – Oct 13, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pata_arasan_cf: remove bogus to_platform_device() calls

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()...

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

 drivers/ata/pata_arasan_cf.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/ata/pata_arasan_cf.c +2 -4
Index: 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 on v1 1/1
#1 lore raw
Quoted 36 lines · Sergei Shtylyov

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()...

---
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
===================================================================

drivers/ata/pata_arasan_cf.c +2 -4
@@ -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);
Quoted 2 lines

.

Signature · 1 line
viresh