Skip to content

Commit

Permalink
ALSA: aoa: Remove obsolete cleanup for clientdata
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Axel Lin authored and Takashi Iwai committed Sep 12, 2011
1 parent 89f3325 commit 5758960
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sound/aoa/codecs/onyx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 5758960

Please sign in to comment.