OSDN Git Service

ALSA: compress: Use snd_compr_get_poll on error path
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Wed, 4 May 2016 13:59:08 +0000 (14:59 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 9 May 2016 15:35:14 +0000 (17:35 +0200)
We have a function that returns the appropriate flags for the stream
direction, so we should use it.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/compress_offload.c

index a9933c0..5268546 100644 (file)
@@ -421,10 +421,7 @@ static unsigned int snd_compr_poll(struct file *f, poll_table *wait)
                        retval = snd_compr_get_poll(stream);
                break;
        default:
-               if (stream->direction == SND_COMPRESS_PLAYBACK)
-                       retval = POLLOUT | POLLWRNORM | POLLERR;
-               else
-                       retval = POLLIN | POLLRDNORM | POLLERR;
+               retval = snd_compr_get_poll(stream) | POLLERR;
                break;
        }
 out: