]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - sound/soc/codecs/cs42l52.c
Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / sound / soc / codecs / cs42l52.c
index 9811a5478c87649da6c42806a3a43bfcc5a5767e..0f6f481cec09cd941688ed790ecd31e10e207496 100644 (file)
@@ -1038,7 +1038,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;
@@ -1059,7 +1059,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");
        }
@@ -1076,7 +1075,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;