From: Axel Lin Date: Tue, 25 Dec 2012 05:28:26 +0000 (+0800) Subject: ASoC: cs42l52: Convert to devm_input_allocate_device() X-Git-Tag: Ubuntu-snapdragon-4.4.0-1050.54~13101^2~24^2~20^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=e958f8b806c3953fcadce3929400638ae0dc796f;p=mirror_ubuntu-artful-kernel.git ASoC: cs42l52: Convert to devm_input_allocate_device() Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c index 99bb1c69499e..73a804931cff 100644 --- a/sound/soc/codecs/cs42l52.c +++ b/sound/soc/codecs/cs42l52.c @@ -1040,7 +1040,7 @@ static void cs42l52_init_beep(struct snd_soc_codec *codec) struct cs42l52_private *cs42l52 = snd_soc_codec_get_drvdata(codec); int ret; - cs42l52->beep = input_allocate_device(); + cs42l52->beep = devm_input_allocate_device(codec->dev); if (!cs42l52->beep) { dev_err(codec->dev, "Failed to allocate beep device\n"); return; @@ -1061,7 +1061,6 @@ static void cs42l52_init_beep(struct snd_soc_codec *codec) ret = input_register_device(cs42l52->beep); if (ret != 0) { - input_free_device(cs42l52->beep); cs42l52->beep = NULL; dev_err(codec->dev, "Failed to register beep device\n"); } @@ -1078,7 +1077,6 @@ static void cs42l52_free_beep(struct snd_soc_codec *codec) struct cs42l52_private *cs42l52 = snd_soc_codec_get_drvdata(codec); device_remove_file(codec->dev, &dev_attr_beep); - input_unregister_device(cs42l52->beep); cancel_work_sync(&cs42l52->beep_work); cs42l52->beep = NULL;