linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lpc_ich: use devres API to allocate private data
       [not found] <774339a2-e7cc-4204-a935-0a1b59e2ece8@zimbra>
@ 2013-02-14 17:35 ` Aaron Sierra
  2013-02-15 14:56   ` Aaron Sierra
  2013-02-15 17:45   ` Samuel Ortiz
  0 siblings, 2 replies; 3+ messages in thread
From: Aaron Sierra @ 2013-02-14 17:35 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: LKML


Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
---
 drivers/mfd/lpc_ich.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c
index a0cfdf9..1264b68 100644
--- a/drivers/mfd/lpc_ich.c
+++ b/drivers/mfd/lpc_ich.c
@@ -878,7 +878,8 @@ static int lpc_ich_probe(struct pci_dev *dev,
 	int ret;
 	bool cell_added = false;
 
-	priv = kmalloc(GFP_KERNEL, sizeof(struct lpc_ich_priv));
+	priv = devm_kzalloc(&dev->dev,
+			    sizeof(struct lpc_ich_priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
@@ -914,7 +915,6 @@ static int lpc_ich_probe(struct pci_dev *dev,
 		dev_warn(&dev->dev, "No MFD cells added\n");
 		lpc_ich_restore_config_space(dev);
 		pci_set_drvdata(dev, NULL);
-		kfree(priv);
 		return -ENODEV;
 	}
 
@@ -923,12 +923,9 @@ static int lpc_ich_probe(struct pci_dev *dev,
 
 static void lpc_ich_remove(struct pci_dev *dev)
 {
-	void *priv = pci_get_drvdata(dev);
-
 	mfd_remove_devices(&dev->dev);
 	lpc_ich_restore_config_space(dev);
 	pci_set_drvdata(dev, NULL);
-	kfree(priv);
 }
 
 static struct pci_driver lpc_ich_driver = {
-- 
1.7.9.5

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

* Re: [PATCH] lpc_ich: use devres API to allocate private data
  2013-02-14 17:35 ` [PATCH] lpc_ich: use devres API to allocate private data Aaron Sierra
@ 2013-02-15 14:56   ` Aaron Sierra
  2013-02-15 17:45   ` Samuel Ortiz
  1 sibling, 0 replies; 3+ messages in thread
From: Aaron Sierra @ 2013-02-15 14:56 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: LKML, Anatol Pomozov


----- Original Message -----
> From: "Aaron Sierra" <asierra@xes-inc.com>
> To: "Samuel Ortiz" <sameo@linux.intel.com>
> Cc: "LKML" <linux-kernel@vger.kernel.org>
> Sent: Thursday, February 14, 2013 11:35:04 AM
> Subject: [PATCH] lpc_ich: use devres API to allocate private data
>
> 
> Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
> ---

[trim]

> -	priv = kmalloc(GFP_KERNEL, sizeof(struct lpc_ich_priv));
> +	priv = devm_kzalloc(&dev->dev,
> +			    sizeof(struct lpc_ich_priv), GFP_KERNEL);

Samuel,
Perhaps this should now include a comment about this patch also resolving the issue that Anatol reported yesterday?

-Aaron

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

* Re: [PATCH] lpc_ich: use devres API to allocate private data
  2013-02-14 17:35 ` [PATCH] lpc_ich: use devres API to allocate private data Aaron Sierra
  2013-02-15 14:56   ` Aaron Sierra
@ 2013-02-15 17:45   ` Samuel Ortiz
  1 sibling, 0 replies; 3+ messages in thread
From: Samuel Ortiz @ 2013-02-15 17:45 UTC (permalink / raw)
  To: Aaron Sierra; +Cc: LKML

Hi Arron,

On Thu, Feb 14, 2013 at 11:35:04AM -0600, Aaron Sierra wrote:
> 
> Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
> ---
>  drivers/mfd/lpc_ich.c |    7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
Applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

end of thread, other threads:[~2013-02-15 17:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <774339a2-e7cc-4204-a935-0a1b59e2ece8@zimbra>
2013-02-14 17:35 ` [PATCH] lpc_ich: use devres API to allocate private data Aaron Sierra
2013-02-15 14:56   ` Aaron Sierra
2013-02-15 17:45   ` Samuel Ortiz

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