Re: [PATCH v8 1/7] mfd: Add core driver for Nuvoton NCT6694

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Marc,

Thank you for reviewing,

Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> 於 2025年2月28日 週五 下午4:52寫道:
>
> > +static int nct6694_usb_probe(struct usb_interface *iface,
> > +                          const struct usb_device_id *id)
> > +{
> > +     struct usb_device *udev = interface_to_usbdev(iface);
> > +     struct usb_endpoint_descriptor *int_endpoint;
> > +     struct usb_host_interface *interface;
> > +     struct device *dev = &iface->dev;
> > +     struct nct6694 *nct6694;
> > +     int pipe, maxp;
> > +     int ret;
> > +
> > +     nct6694 = devm_kzalloc(dev, sizeof(*nct6694), GFP_KERNEL);
> > +     if (!nct6694)
> > +             return -ENOMEM;
> > +
> > +     pipe = usb_rcvintpipe(udev, NCT6694_INT_IN_EP);
> > +     maxp = usb_maxpacket(udev, pipe);
> > +
> > +     nct6694->usb_msg = devm_kzalloc(dev, sizeof(union nct6694_usb_msg), GFP_KERNEL);
> > +     if (!nct6694->usb_msg)
> > +             return -ENOMEM;
> > +
> > +     nct6694->int_buffer = devm_kzalloc(dev, maxp, GFP_KERNEL);
> > +     if (!nct6694->int_buffer)
> > +             return -ENOMEM;
> > +
> > +     nct6694->int_in_urb = usb_alloc_urb(0, GFP_KERNEL);
> > +     if (!nct6694->int_in_urb)
> > +             return -ENOMEM;
> > +
> > +     nct6694->domain = irq_domain_add_simple(NULL, NCT6694_NR_IRQS, 0,
> > +                                             &nct6694_irq_domain_ops,
> > +                                             nct6694);
> > +     if (!nct6694->domain) {
> > +             ret = -ENODEV;
> > +             goto err_urb;
> > +     }
> > +
> > +     nct6694->dev = dev;
> > +     nct6694->udev = udev;
> > +     nct6694->timeout = NCT6694_URB_TIMEOUT; /* Wait until URB completes */
>
> Why do you need this variable? You can directly use NCT6694_URB_TIMEOUT
> in the usb_bulk_msg() and friends calls.
>

Okay, I will make the modifications in the next patch.


Best regards,
Ming





[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux