Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57589603 authored by Axel Lin's avatar Axel Lin Committed by Takashi Iwai
Browse files

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.

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Reviewed-by: default avatarWolfram Sang <w.sang@pengutronix.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 89f3325a
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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,7 +1111,6 @@ 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);
	return 0;