Ah nevermind looks like there is already a way to get this info via the controller sysfs : /sys/devices/soc/a800000.ssusb/a800000.dwc3/gadget/sound/card7/midiC7D0/. Let's drop this patch --Jerry On Mon, Apr 9, 2018 at 6:56 PM Jerry Zhang <zhangjerry@xxxxxxxxxx> wrote: > I didn't realize that having function in func_inst was actually android > only. I think we can track card and device values in f_midi_opts in that > case, and update them as they change. I'll put up a fix soon. > On Mon, Apr 9, 2018 at 6:27 PM kbuild test robot <lkp@xxxxxxxxx> wrote: > > Hi Jerry, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on balbi-usb/next] > > [also build test ERROR on v4.16 next-20180409] > > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > > url: https://github.com/0day-ci/linux/commits/Jerry-Zhang/usb-gadget-f_midi-Add-configfs-attrs-for-card-and-device/20180410-061518 > > base: https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next > > config: x86_64-randconfig-x011-201814 (attached as .config) > > compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 > > reproduce: > > # save the attached .config to linux build tree > > make ARCH=x86_64 > > All errors (new ones prefixed by >>): > > drivers/usb/gadget/function/f_midi.c: In function > 'f_midi_opts_card_show': > > >> drivers/usb/gadget/function/f_midi.c:1188:22: error: 'struct > usb_function_instance' has no member named 'f'; did you mean 'fd'? > > if (opts->func_inst.f) { > > ^ > > fd > > drivers/usb/gadget/function/f_midi.c:1189:39: error: 'struct > usb_function_instance' has no member named 'f'; did you mean 'fd'? > > midi = func_to_midi(opts->func_inst.f); > > ^ > > fd > > drivers/usb/gadget/function/f_midi.c: In function > 'f_midi_opts_device_show': > > drivers/usb/gadget/function/f_midi.c:1206:22: error: 'struct > usb_function_instance' has no member named 'f'; did you mean 'fd'? > > if (opts->func_inst.f) { > > ^ > > fd > > drivers/usb/gadget/function/f_midi.c:1207:39: error: 'struct > usb_function_instance' has no member named 'f'; did you mean 'fd'? > > midi = func_to_midi(opts->func_inst.f); > > ^ > > fd > > vim +1188 drivers/usb/gadget/function/f_midi.c > > 1181 > > 1182 static ssize_t f_midi_opts_card_show(struct config_item *item, > char *page) > > 1183 { > > 1184 struct f_midi_opts *opts = to_f_midi_opts(item); > > 1185 int card = -1; > > 1186 struct f_midi *midi; > > 1187 > > > 1188 if (opts->func_inst.f) { > > 1189 midi = func_to_midi(opts->func_inst.f); > > 1190 if (midi->rmidi && midi->rmidi->card) { > > 1191 card = midi->rmidi->card->number; > > 1192 } > > 1193 } > > 1194 > > 1195 return sprintf(page, "%d\n", card); > > 1196 } > > 1197 > > --- > > 0-DAY kernel test infrastructure Open Source Technology > Center > > https://lists.01.org/pipermail/kbuild-all Intel > Corporation -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html