From 10957dd96e3cfd9f349ef443be13c116dd50ae82 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Tue, 6 Dec 2016 18:34:40 -0800 Subject: [PATCH] sound: usb: Handle implicit feedback data endpoint properly For the devices supporting implicit feedback over data endpoint usb audio driver instantiates snd_usb_endpoint as sync_endpoint even though there is no real usb sync endpoint exists. QMI driver looks for usb endpoint if sync_endpoint is instantiated and bails out if endpoint related context does not exist. This causes such devices to not work. Hence do not bail out if sync ep context does not exist and continue preparing the QMI response. Change-Id: I7d96555573cfd6cca1ca56c877d78fde943f8100 Signed-off-by: Hemant Kumar --- sound/usb/usb_audio_qmi_svc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/usb/usb_audio_qmi_svc.c b/sound/usb/usb_audio_qmi_svc.c index 22468eee62db..8ce87195548e 100644 --- a/sound/usb/usb_audio_qmi_svc.c +++ b/sound/usb/usb_audio_qmi_svc.c @@ -495,9 +495,8 @@ static int prepare_qmi_response(struct snd_usb_substream *subs, if (subs->sync_endpoint) { ep = usb_pipe_endpoint(subs->dev, subs->sync_endpoint->pipe); if (!ep) { - pr_err("%s: sync ep # %d context is null\n", __func__, - subs->sync_endpoint->ep_num); - goto err; + pr_debug("%s: implicit fb on data ep\n", __func__); + goto skip_sync_ep; } memcpy(&resp->std_as_sync_ep_desc, &ep->desc, sizeof(ep->desc)); resp->std_as_sync_ep_desc_valid = 1; @@ -511,6 +510,7 @@ static int prepare_qmi_response(struct snd_usb_substream *subs, resp->xhci_mem_info.tr_sync.pa = xhci_pa; } +skip_sync_ep: resp->interrupter_num = uaudio_qdev->intr_num; resp->interrupter_num_valid = 1; -- 2.11.0