Messages in this thread | | | Date | Wed, 15 Jun 2022 20:18:47 -0500 | Subject | Re: [PATCH v5 1/3] mfd: ch341: add core driver for the WCH CH341 in I2C/SPI/GPIO mode | From | Frank Zago <> |
| |
Hi Lee,
>> + dev->ep_in = endpoints[0].desc.bEndpointAddress; >> + dev->ep_out = endpoints[1].desc.bEndpointAddress; >> + dev->ep_intr = endpoints[2].desc.bEndpointAddress; >> + dev->ep_intr_interval = endpoints[2].desc.bInterval; >> + >> + usb_set_intfdata(iface, dev); >> + >> + rc = mfd_add_hotplug_devices(&iface->dev, ch341_devs, > > Why are you using 'hotplug' here?
I replaced with mfd_add_devices, however I'm not sure what the difference is since mfd_add_hotplug_devices() is just a helper with less parameters. That's what the viperboard driver does; I just copied since both devices are similar in functionality.
> > ch341_devs is empty right? > > So no child devices are registered. > > In which case this is not (yet) an MFD and cannot be accepted. > > Please add the children. > >> + ARRAY_SIZE(ch341_devs)); >> + if (rc) { >> + rc = dev_err_probe(&iface->dev, rc, >> + "Failed to add mfd devices to core\n"); > > I'm not even sure what this means. Should be: > > "Failed to register child devices\n"
Changed. The original string was also from the viperboard driver.
> >> +MODULE_DESCRIPTION("CH341 USB to I2C/SPI/GPIO adapter"); > > Is it? What makes it one of those?
That's what this chip does, in addition to UART and printer modes. See patch 4.
Frank.
| |