ALSA: usb: Fix Processing Unit Descriptor parsers
[~shefty/rdma-dev.git] / include / uapi / linux / usb / audio.h
index ac90037894d9133a17ca621b73fa95b305dabc89..d2314be4f0c03381c1390f0d0d3eefe4f958f4ed 100644 (file)
@@ -384,14 +384,16 @@ static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_de
                                                   int protocol)
 {
        __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
                                                   int protocol)
 {
        __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
-       return desc->baSourceID[desc->bNrInPins + control_size];
+       return *(uac_processing_unit_bmControls(desc, protocol)
+                       + control_size);
 }
 
 static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_descriptor *desc,
                                                 int protocol)
 {
        __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
 }
 
 static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_descriptor *desc,
                                                 int protocol)
 {
        __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
-       return &desc->baSourceID[desc->bNrInPins + control_size + 1];
+       return uac_processing_unit_bmControls(desc, protocol)
+                       + control_size + 1;
 }
 
 /* 4.5.2 Class-Specific AS Interface Descriptor */
 }
 
 /* 4.5.2 Class-Specific AS Interface Descriptor */