Re: [PATCH v1 1/9] mfd: Add core driver for Nuvoton NCT6694

Marc Kleine-Budde
2024-10-24T09:58:15Z

[-- Attachment #1: Type: text/plain, Size: 1337 bytes --]

On 24.10.2024 16:59:14, Ming Yu wrote:
> +static int nct6694_usb_probe(struct usb_interface *iface,
> + const struct usb_device_id *id)
> +{
> + struct usb_device *udev = interface_to_usbdev(iface);
> + struct device *dev = &udev->dev;
> + struct usb_host_interface *interface;
> + struct usb_endpoint_descriptor *int_endpoint;
> + struct nct6694 *nct6694;
> + int pipe, maxp, bulk_pipe;
> + int ret = EINVAL;
> +
> + interface = iface->cur_altsetting;
> + /* Binding interface class : 0xFF */
> + if (interface->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC ||
> + interface->desc.bInterfaceSubClass != 0x00 ||
> + interface->desc.bInterfaceProtocol != 0x00)
> + return -ENODEV;

I think you can use USB_DEVICE_INFO() and remove this manual check

https://elixir.bootlin.com/linux/v6.11.5/source/include/linux/usb.h#L1056

[...]

> +
> +static const struct usb_device_id nct6694_ids[] = {
> + { USB_DEVICE(NCT6694_VENDOR_ID, NCT6694_PRODUCT_ID)},
> + {},
> +};
> +MODULE_DEVICE_TABLE(usb, nct6694_ids);

regards,
Marc

--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]