diff mbox series

[11/11] usb: gadget: Replace runtime->status->state reference to runtime->state

Message ID 20220926135558.26580-12-tiwai@suse.de (mailing list archive)
State Accepted
Commit 675b7cd16e21ce2452d4a11ed425996c34e5460c
Headers show
Series ALSA: PCM state reference optimization | expand

Commit Message

Takashi Iwai Sept. 26, 2022, 1:55 p.m. UTC
The recent change in ALSA core allows drivers to get the current PCM
state directly from runtime object.  Replace the calls accordingly.

Cc: Felipe Balbi <balbi@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---

I'm going to merge this through sound git tree as it requires ALSA core
changes.

 drivers/usb/gadget/function/u_uac1_legacy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Greg Kroah-Hartman Sept. 26, 2022, 2:05 p.m. UTC | #1
On Mon, Sep 26, 2022 at 03:55:58PM +0200, Takashi Iwai wrote:
> The recent change in ALSA core allows drivers to get the current PCM
> state directly from runtime object.  Replace the calls accordingly.
> 
> Cc: Felipe Balbi <balbi@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
> 
> I'm going to merge this through sound git tree as it requires ALSA core
> changes.

Looks good to me:

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff mbox series

Patch

diff --git a/drivers/usb/gadget/function/u_uac1_legacy.c b/drivers/usb/gadget/function/u_uac1_legacy.c
index 60ae8b2d3f6a..dd21c251542c 100644
--- a/drivers/usb/gadget/function/u_uac1_legacy.c
+++ b/drivers/usb/gadget/function/u_uac1_legacy.c
@@ -158,8 +158,8 @@  size_t u_audio_playback(struct gaudio *card, void *buf, size_t count)
 	snd_pcm_sframes_t frames;
 
 try_again:
-	if (runtime->status->state == SNDRV_PCM_STATE_XRUN ||
-		runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
+	if (runtime->state == SNDRV_PCM_STATE_XRUN ||
+		runtime->state == SNDRV_PCM_STATE_SUSPENDED) {
 		result = snd_pcm_kernel_ioctl(substream,
 				SNDRV_PCM_IOCTL_PREPARE, NULL);
 		if (result < 0) {