sata_nv: fix fallout of devres conversion
authorTejun Heo <htejun@gmail.com>
Thu, 17 May 2007 11:13:57 +0000 (13:13 +0200)
committerJeff Garzik <jeff@garzik.org>
Fri, 18 May 2007 00:57:10 +0000 (20:57 -0400)
As with all other drivers, sata_nv's hpriv is allocated with
devm_kzalloc() and there's no need to free it explicitly.  Kill
nv_remove_one() which incorrectly used kfree() instead of devm_kfree()
and use ata_pci_remove_one() directly.

Original fix is from Peer Chen.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Peer Chen <pchen@nvidia.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/sata_nv.c

index 82a615d..1a49c77 100644 (file)
@@ -229,7 +229,6 @@ struct nv_host_priv {
 #define NV_ADMA_CHECK_INTR(GCTL, PORT) ((GCTL) & ( 1 << (19 + (12 * (PORT)))))
 
 static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
-static void nv_remove_one (struct pci_dev *pdev);
 #ifdef CONFIG_PM
 static int nv_pci_device_resume(struct pci_dev *pdev);
 #endif
@@ -300,7 +299,7 @@ static struct pci_driver nv_pci_driver = {
        .suspend                = ata_pci_device_suspend,
        .resume                 = nv_pci_device_resume,
 #endif
-       .remove                 = nv_remove_one,
+       .remove                 = ata_pci_remove_one,
 };
 
 static struct scsi_host_template nv_sht = {
@@ -1607,15 +1606,6 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
                                 IRQF_SHARED, ppi[0]->sht);
 }
 
-static void nv_remove_one (struct pci_dev *pdev)
-{
-       struct ata_host *host = dev_get_drvdata(&pdev->dev);
-       struct nv_host_priv *hpriv = host->private_data;
-
-       ata_pci_remove_one(pdev);
-       kfree(hpriv);
-}
-
 #ifdef CONFIG_PM
 static int nv_pci_device_resume(struct pci_dev *pdev)
 {