public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mfd: Store wm8350 struct in core device driver data
@ 2011-12-08  2:55 Mark Brown
  2011-12-08  2:55 ` [PATCH 2/2] mfd: Convert WM8350 to devm_kzalloc() Mark Brown
  2011-12-12 15:18 ` [PATCH 1/2] mfd: Store wm8350 struct in core device driver data Samuel Ortiz
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Brown @ 2011-12-08  2:55 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel, patches, Mark Brown

This will allow us to move to a more idiomatic MFD model as drivers
will be able to get the struct by looking at their parent device.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/mfd/wm8350-core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
index e81cc31..dd1caaa 100644
--- a/drivers/mfd/wm8350-core.c
+++ b/drivers/mfd/wm8350-core.c
@@ -573,6 +573,8 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq,
 	u16 id1, id2, mask_rev;
 	u16 cust_id, mode, chip_rev;
 
+	dev_set_drvdata(wm8350->dev, wm8350);
+
 	/* get WM8350 revision and config mode */
 	ret = wm8350->read_dev(wm8350, WM8350_RESET_ID, sizeof(id1), &id1);
 	if (ret != 0) {
-- 
1.7.7.3


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

* [PATCH 2/2] mfd: Convert WM8350 to devm_kzalloc()
  2011-12-08  2:55 [PATCH 1/2] mfd: Store wm8350 struct in core device driver data Mark Brown
@ 2011-12-08  2:55 ` Mark Brown
  2011-12-12 15:18   ` Samuel Ortiz
  2011-12-12 15:18 ` [PATCH 1/2] mfd: Store wm8350 struct in core device driver data Samuel Ortiz
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2011-12-08  2:55 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel, patches, Mark Brown

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/mfd/wm8350-i2c.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/wm8350-i2c.c b/drivers/mfd/wm8350-i2c.c
index 5fe5de1..d955faa 100644
--- a/drivers/mfd/wm8350-i2c.c
+++ b/drivers/mfd/wm8350-i2c.c
@@ -63,7 +63,7 @@ static int wm8350_i2c_probe(struct i2c_client *i2c,
 	struct wm8350 *wm8350;
 	int ret = 0;
 
-	wm8350 = kzalloc(sizeof(struct wm8350), GFP_KERNEL);
+	wm8350 = devm_kzalloc(&i2c->dev, sizeof(struct wm8350), GFP_KERNEL);
 	if (wm8350 == NULL)
 		return -ENOMEM;
 
@@ -80,7 +80,6 @@ static int wm8350_i2c_probe(struct i2c_client *i2c,
 	return ret;
 
 err:
-	kfree(wm8350);
 	return ret;
 }
 
@@ -89,7 +88,6 @@ static int wm8350_i2c_remove(struct i2c_client *i2c)
 	struct wm8350 *wm8350 = i2c_get_clientdata(i2c);
 
 	wm8350_device_exit(wm8350);
-	kfree(wm8350);
 
 	return 0;
 }
-- 
1.7.7.3


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

* Re: [PATCH 1/2] mfd: Store wm8350 struct in core device driver data
  2011-12-08  2:55 [PATCH 1/2] mfd: Store wm8350 struct in core device driver data Mark Brown
  2011-12-08  2:55 ` [PATCH 2/2] mfd: Convert WM8350 to devm_kzalloc() Mark Brown
@ 2011-12-12 15:18 ` Samuel Ortiz
  1 sibling, 0 replies; 4+ messages in thread
From: Samuel Ortiz @ 2011-12-12 15:18 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, patches

Hi Mark,

On Thu, Dec 08, 2011 at 10:55:21AM +0800, Mark Brown wrote:
> This will allow us to move to a more idiomatic MFD model as drivers
> will be able to get the struct by looking at their parent device.

Patch applied, thanks.

Cheers,
Samuel.

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

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

* Re: [PATCH 2/2] mfd: Convert WM8350 to devm_kzalloc()
  2011-12-08  2:55 ` [PATCH 2/2] mfd: Convert WM8350 to devm_kzalloc() Mark Brown
@ 2011-12-12 15:18   ` Samuel Ortiz
  0 siblings, 0 replies; 4+ messages in thread
From: Samuel Ortiz @ 2011-12-12 15:18 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, patches

Hi Mark,

On Thu, Dec 08, 2011 at 10:55:22AM +0800, Mark Brown wrote:
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Applied as well, many thanks.

Cheers,
Samuel.

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

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

end of thread, other threads:[~2011-12-12 15:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-08  2:55 [PATCH 1/2] mfd: Store wm8350 struct in core device driver data Mark Brown
2011-12-08  2:55 ` [PATCH 2/2] mfd: Convert WM8350 to devm_kzalloc() Mark Brown
2011-12-12 15:18   ` Samuel Ortiz
2011-12-12 15:18 ` [PATCH 1/2] mfd: Store wm8350 struct in core device driver data Samuel Ortiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox