[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YjCi/cRY51tYUowD@kroah.com>
Date: Tue, 15 Mar 2022 15:30:21 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: frank zago <frank@...o.net>
Cc: linux-kernel@...r.kernel.org,
Jan-Niklas Burfeind <kernel@...ionpri.me>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Wolfram Sang <wsa@...nel.org>, Johan Hovold <johan@...nel.org>,
linux-usb@...r.kernel.org, gunar@...orcht.net,
Lee Jones <lee.jones@...aro.org>
Subject: Re: [PATCH v3] mfd: ch341: add driver for the WCH CH341 in I2C/GPIO
mode
On Sun, Mar 13, 2022 at 10:09:37PM -0500, frank zago wrote:
> +static int ch341_usb_probe(struct usb_interface *iface,
> + const struct usb_device_id *usb_id)
> +{
> + struct usb_host_endpoint *endpoints;
> + struct ch341_device *dev;
> + int rc;
> +
> + dev = kzalloc(sizeof(struct ch341_device), GFP_KERNEL);
> + if (!dev)
> + return -ENOMEM;
> +
> + dev->usb_dev = usb_get_dev(interface_to_usbdev(iface));
> + dev->iface = iface;
> + mutex_init(&dev->usb_lock);
> +
> + if (iface->cur_altsetting->desc.bNumEndpoints != 3) {
> + rc = -EIO;
-ENODEV is the proper one here.
> + goto free_dev;
> + }
> +
> + endpoints = iface->cur_altsetting->endpoint;
> + if (!usb_endpoint_is_bulk_in(&endpoints[0].desc) ||
> + !usb_endpoint_is_bulk_out(&endpoints[1].desc) ||
> + !usb_endpoint_xfer_int(&endpoints[2].desc)) {
> + rc = -EIO;
Same here.
thanks,
greg k-h
Powered by blists - more mailing lists