Skip to content

Commit 5758960

Browse files
AxelLintiwai
authored andcommitted
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: Axel Lin <axel.lin@gmail.com> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 89f3325 commit 5758960

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎sound/aoa/codecs/onyx.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,6 @@ static int onyx_i2c_probe(struct i2c_client *client,
10671067
printk(KERN_DEBUG PFX "created and attached onyx instance\n");
10681068
return 0;
10691069
fail:
1070-
i2c_set_clientdata(client, NULL);
10711070
kfree(onyx);
10721071
return -ENODEV;
10731072
}
@@ -1112,8 +1111,7 @@ static int onyx_i2c_remove(struct i2c_client *client)
11121111

11131112
aoa_codec_unregister(&onyx->codec);
11141113
of_node_put(onyx->codec.node);
1115-
if (onyx->codec_info)
1116-
kfree(onyx->codec_info);
1114+
kfree(onyx->codec_info);
11171115
kfree(onyx);
11181116
return 0;
11191117
}

0 commit comments

Comments
 (0)