From: Tejun Heo <htejun@gmail.com>
To: Peer Chen <pchen@nvidia.com>
Cc: Jeff Garzik <jeff@garzik.org>,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: [PATCH] sata_nv: fix fallout of devres conversion
Date: Thu, 17 May 2007 13:13:57 +0200 [thread overview]
Message-ID: <464C38F5.3060802@gmail.com> (raw)
In-Reply-To: <15F501D1A78BD343BE8F4D8DB854566B13DEF520@hkemmail01.nvidia.com>
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>
---
I think it's prettier this way. :-)
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 4cea3ef..5be4e28 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -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
@@ -306,7 +305,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 = {
@@ -1613,15 +1612,6 @@ static int nv_init_one (struct pci_dev *
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)
{
next prev parent reply other threads:[~2007-05-17 11:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <15F501D1A78BD343BE8F4D8DB854566B13CD8F45@hkemmail01.nvidia.com>
2007-05-16 5:21 ` [PATCH] drivers/ata: correct a wrong free function for sata_nv driver Jeff Garzik
2007-05-16 5:31 ` Peer Chen
2007-05-17 11:13 ` Tejun Heo [this message]
2007-05-18 0:58 ` [PATCH] sata_nv: fix fallout of devres conversion Jeff Garzik
[not found] ` <15F501D1A78BD343BE8F4D8DB854566B13F197C0@hkemmail01.nvidia.com>
2007-05-18 1:47 ` [PATCH] drivers/ata: Add the SW NCQ support to sata_nv for MCP51/MCP55/MCP61 Robert Hancock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=464C38F5.3060802@gmail.com \
--to=htejun@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pchen@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).