]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
hid: jarvis: Remove redundant coherency protection
authorXia Yang <xiay@nvidia.com>
Wed, 28 Jan 2015 01:14:58 +0000 (17:14 -0800)
committerXia Yang <xiay@nvidia.com>
Thu, 19 Mar 2015 22:46:54 +0000 (15:46 -0700)
ALSA framework already took care of it.

Bug 1599000

Change-Id: I0e3f9c2c011d8f36c480736c1af03959fb37e5d8
Signed-off-by: Xia Yang <xiay@nvidia.com>
Reviewed-on: http://git-master/r/678005
(cherry picked from commit 74286d788c34f0b494de70544dc34e037f91f542)
Reviewed-on: http://git-master/r/716501
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
drivers/hid/hid-atv-jarvis.c

index ba01ceb05a5d708807cdff3cfa357894c7582b22..b3347e872f13e787521b24f0c039b3c794f06768 100644 (file)
@@ -343,7 +343,6 @@ struct snd_atvr {
 
        /* pointer to hid device */
        struct hid_device *hdev;
-       atomic_t occupied;
 };
 
 static int atvr_mic_ctrl(struct hid_device *hdev, bool enable)
@@ -1052,28 +1051,20 @@ static int snd_atvr_pcm_open(struct snd_pcm_substream *substream)
        struct snd_pcm_runtime *runtime = substream->runtime;
        int ret;
 
-       if (unlikely(atomic_xchg(&atvr_snd->occupied, 1) == 1))
-               return -EBUSY;
-
        if (atvr_snd->hdev == NULL) {
                pr_warn("%s: remote is not ready\n", __func__);
-               atomic_xchg(&atvr_snd->occupied, 0);
                return -EAGAIN;
        }
 
        ret = atvr_mic_ctrl(atvr_snd->hdev, true);
 
-       if (ret) {
-               atomic_xchg(&atvr_snd->occupied, 0);
+       if (ret)
                return ret;
-       }
 
        ret = atomic_fifo_init(&atvr_snd->fifo_controller,
                                   MAX_PACKETS_PER_BUFFER);
-       if (ret) {
-               atomic_xchg(&atvr_snd->occupied, 0);
+       if (ret)
                return ret;
-       }
 
        runtime->hw = atvr_snd->pcm_hw;
        if (substream->pcm->device & 1) {
@@ -1097,7 +1088,6 @@ static int snd_atvr_pcm_open(struct snd_pcm_substream *substream)
        if (atvr_snd->pcm_buffer == NULL) {
                pr_err("%s:%d - ERROR PCM buffer allocation failed\n",
                        __func__, __LINE__);
-               atomic_xchg(&atvr_snd->occupied, 0);
                return -ENOMEM;
        }
 
@@ -1110,7 +1100,6 @@ static int snd_atvr_pcm_open(struct snd_pcm_substream *substream)
                        __func__, __LINE__);
                vfree(atvr_snd->pcm_buffer);
                atvr_snd->pcm_buffer = NULL;
-               atomic_xchg(&atvr_snd->occupied, 0);
                return -ENOMEM;
        }
 
@@ -1146,8 +1135,6 @@ static int snd_atvr_pcm_close(struct snd_pcm_substream *substream)
        }
        spin_unlock(&s_substream_lock);
 
-       atomic_xchg(&atvr_snd->occupied, 0);
-
        if (atvr_snd->hdev)
                atvr_mic_ctrl(atvr_snd->hdev, false);
        else
@@ -1264,7 +1251,6 @@ static int atvr_snd_initialize(struct hid_device *hdev)
        }
        atvr_snd = atvr_card->private_data;
        atvr_snd->card = atvr_card;
-       atomic_set(&atvr_snd->occupied, 0);
 
        /* dummy initialization */
        setup_timer(&atvr_snd->decoding_timer,