Skip to contentSkip to conversation

ALSA: aoa: Remove obsolete cleanup for clientdata

PATCH In review Axel Lin 2 participants 2 messages Sep 9, 2011 – Sep 12, 2011

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH v2 1/1 ALSA: aoa: Remove obsolete cleanup for clientdata

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.

---
 sound/aoa/codecs/onyx.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
sound/aoa/codecs/onyx.c +1 -3
index 3687a6c..762af68 100644
@@ -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;
 }
Signature · 1 line
1.7.4.1
#1 lore raw

At Fri, 09 Sep 2011 19:04:45 +0800,

Quoted 9 lines · Axel Lin

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.

Applied now. Thanks.

Takashi

Quoted 31 lines
---
 sound/aoa/codecs/onyx.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
sound/aoa/codecs/onyx.c +1 -3
index 3687a6c..762af68 100644
@@ -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;
 }
Signature · 1 line
1.7.4.1