aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8962.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm8962.c')
-rw-r--r--sound/soc/codecs/wm8962.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 705d0a0e9137..0b3680315df8 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3189,7 +3189,7 @@ static void wm8962_init_beep(struct snd_soc_codec *codec)
3189 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); 3189 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
3190 int ret; 3190 int ret;
3191 3191
3192 wm8962->beep = input_allocate_device(); 3192 wm8962->beep = devm_input_allocate_device(codec->dev);
3193 if (!wm8962->beep) { 3193 if (!wm8962->beep) {
3194 dev_err(codec->dev, "Failed to allocate beep device\n"); 3194 dev_err(codec->dev, "Failed to allocate beep device\n");
3195 return; 3195 return;
@@ -3210,7 +3210,6 @@ static void wm8962_init_beep(struct snd_soc_codec *codec)
3210 3210
3211 ret = input_register_device(wm8962->beep); 3211 ret = input_register_device(wm8962->beep);
3212 if (ret != 0) { 3212 if (ret != 0) {
3213 input_free_device(wm8962->beep);
3214 wm8962->beep = NULL; 3213 wm8962->beep = NULL;
3215 dev_err(codec->dev, "Failed to register beep device\n"); 3214 dev_err(codec->dev, "Failed to register beep device\n");
3216 } 3215 }
@@ -3227,7 +3226,6 @@ static void wm8962_free_beep(struct snd_soc_codec *codec)
3227 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); 3226 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
3228 3227
3229 device_remove_file(codec->dev, &dev_attr_beep); 3228 device_remove_file(codec->dev, &dev_attr_beep);
3230 input_unregister_device(wm8962->beep);
3231 cancel_work_sync(&wm8962->beep_work); 3229 cancel_work_sync(&wm8962->beep_work);
3232 wm8962->beep = NULL; 3230 wm8962->beep = NULL;
3233 3231