diff options
author | Axel Lin <axel.lin@ingics.com> | 2012-12-25 00:28:26 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-27 11:46:38 -0500 |
commit | e958f8b806c3953fcadce3929400638ae0dc796f (patch) | |
tree | 02e8fc3f257e55ac0b996d8e3a7eefe2edad17d8 /sound/soc/codecs/cs42l52.c | |
parent | a49f0d1ea3ec94fc7cf33a7c36a16343b74bd565 (diff) |
ASoC: cs42l52: Convert to devm_input_allocate_device()
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/cs42l52.c')
-rw-r--r-- | sound/soc/codecs/cs42l52.c | 4 |
1 files changed, 1 insertions, 3 deletions
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) | |||
1040 | struct cs42l52_private *cs42l52 = snd_soc_codec_get_drvdata(codec); | 1040 | struct cs42l52_private *cs42l52 = snd_soc_codec_get_drvdata(codec); |
1041 | int ret; | 1041 | int ret; |
1042 | 1042 | ||
1043 | cs42l52->beep = input_allocate_device(); | 1043 | cs42l52->beep = devm_input_allocate_device(codec->dev); |
1044 | if (!cs42l52->beep) { | 1044 | if (!cs42l52->beep) { |
1045 | dev_err(codec->dev, "Failed to allocate beep device\n"); | 1045 | dev_err(codec->dev, "Failed to allocate beep device\n"); |
1046 | return; | 1046 | return; |
@@ -1061,7 +1061,6 @@ static void cs42l52_init_beep(struct snd_soc_codec *codec) | |||
1061 | 1061 | ||
1062 | ret = input_register_device(cs42l52->beep); | 1062 | ret = input_register_device(cs42l52->beep); |
1063 | if (ret != 0) { | 1063 | if (ret != 0) { |
1064 | input_free_device(cs42l52->beep); | ||
1065 | cs42l52->beep = NULL; | 1064 | cs42l52->beep = NULL; |
1066 | dev_err(codec->dev, "Failed to register beep device\n"); | 1065 | dev_err(codec->dev, "Failed to register beep device\n"); |
1067 | } | 1066 | } |
@@ -1078,7 +1077,6 @@ static void cs42l52_free_beep(struct snd_soc_codec *codec) | |||
1078 | struct cs42l52_private *cs42l52 = snd_soc_codec_get_drvdata(codec); | 1077 | struct cs42l52_private *cs42l52 = snd_soc_codec_get_drvdata(codec); |
1079 | 1078 | ||
1080 | device_remove_file(codec->dev, &dev_attr_beep); | 1079 | device_remove_file(codec->dev, &dev_attr_beep); |
1081 | input_unregister_device(cs42l52->beep); | ||
1082 | cancel_work_sync(&cs42l52->beep_work); | 1080 | cancel_work_sync(&cs42l52->beep_work); |
1083 | cs42l52->beep = NULL; | 1081 | cs42l52->beep = NULL; |
1084 | 1082 | ||