All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ALSA: aoa: Remove obsolete cleanup for clientdata
@ 2011-09-09 11:04 Axel Lin
  2011-09-12 11:58   ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Axel Lin @ 2011-09-09 11:04 UTC (permalink / raw)
  To: linux-kernel
  Cc: Johannes Berg, Wolfram Sang, Jaroslav Kysela, Takashi Iwai, alsa-devel

The i2c core will clear the clientdata pointer automatically.
We don't have to set the `data' field to NULL in remove() or
if probe() failed anymore.

Also remove a unneeded NULL checking for kfree.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
---
 sound/aoa/codecs/onyx.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c
index 3687a6c..762af68 100644
--- a/sound/aoa/codecs/onyx.c
+++ b/sound/aoa/codecs/onyx.c
@@ -1067,7 +1067,6 @@ static int onyx_i2c_probe(struct i2c_client *client,
 	printk(KERN_DEBUG PFX "created and attached onyx instance\n");
 	return 0;
  fail:
-	i2c_set_clientdata(client, NULL);
 	kfree(onyx);
 	return -ENODEV;
 }
@@ -1112,8 +1111,7 @@ static int onyx_i2c_remove(struct i2c_client *client)
 
 	aoa_codec_unregister(&onyx->codec);
 	of_node_put(onyx->codec.node);
-	if (onyx->codec_info)
-		kfree(onyx->codec_info);
+	kfree(onyx->codec_info);
 	kfree(onyx);
 	return 0;
 }
-- 
1.7.4.1




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

end of thread, other threads:[~2011-09-12 11:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-09 11:04 [PATCH v2] ALSA: aoa: Remove obsolete cleanup for clientdata Axel Lin
2011-09-12 11:58 ` Takashi Iwai
2011-09-12 11:58   ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.