Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sata_mv: use {platform|pci}_get_drvdata()

The driver uses dev_get_drvdata() to get to the driver data for the
platform and PCI devices, while the corresponding wrappers exists for
them -- in one case it even declares an otherwise unneeded variable
to do that. Switch to using the {platform|pci}_get_drvdata() instead.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

authored by

Sergei Shtylyov and committed by
Jeff Garzik
d8661921 c00a4c9d

+4 -5
+4 -5
drivers/ata/sata_mv.c
··· 4113 4113 */ 4114 4114 static int __devexit mv_platform_remove(struct platform_device *pdev) 4115 4115 { 4116 - struct device *dev = &pdev->dev; 4117 - struct ata_host *host = dev_get_drvdata(dev); 4116 + struct ata_host *host = platform_get_drvdata(pdev); 4118 4117 #if defined(CONFIG_HAVE_CLK) 4119 4118 struct mv_host_priv *hpriv = host->private_data; 4120 4119 #endif ··· 4131 4132 #ifdef CONFIG_PM 4132 4133 static int mv_platform_suspend(struct platform_device *pdev, pm_message_t state) 4133 4134 { 4134 - struct ata_host *host = dev_get_drvdata(&pdev->dev); 4135 + struct ata_host *host = platform_get_drvdata(pdev); 4135 4136 if (host) 4136 4137 return ata_host_suspend(host, state); 4137 4138 else ··· 4140 4141 4141 4142 static int mv_platform_resume(struct platform_device *pdev) 4142 4143 { 4143 - struct ata_host *host = dev_get_drvdata(&pdev->dev); 4144 + struct ata_host *host = platform_get_drvdata(pdev); 4144 4145 int ret; 4145 4146 4146 4147 if (host) { ··· 4355 4356 #ifdef CONFIG_PM 4356 4357 static int mv_pci_device_resume(struct pci_dev *pdev) 4357 4358 { 4358 - struct ata_host *host = dev_get_drvdata(&pdev->dev); 4359 + struct ata_host *host = pci_get_drvdata(pdev); 4359 4360 int rc; 4360 4361 4361 4362 rc = ata_pci_device_do_resume(pdev);