Re: [PATCH 1/6] USB: serial: cp210x: add support for software flow control

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

 



On Mon, Jan 18, 2021 at 01:42:59PM +0100, Greg Kroah-Hartman wrote:
> On Mon, Jan 18, 2021 at 12:13:26PM +0100, Johan Hovold wrote:
> > From: Wang Sheng Long <shenglong.wang.ext@xxxxxxxxxxx>

> > +static int cp210x_set_chars(struct usb_serial_port *port,
> > +		struct cp210x_special_chars *chars)
> > +{
> > +	struct cp210x_port_private *port_priv = usb_get_serial_port_data(port);
> > +	struct usb_serial *serial = port->serial;
> > +	void *dmabuf;
> > +	int result;
> > +
> > +	dmabuf = kmemdup(chars, sizeof(*chars), GFP_KERNEL);
> > +	if (!dmabuf)
> > +		return -ENOMEM;
> > +
> > +	result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
> > +				CP210X_SET_CHARS, REQTYPE_HOST_TO_INTERFACE, 0,
> > +				port_priv->bInterfaceNumber,
> > +				dmabuf, sizeof(*chars), USB_CTRL_SET_TIMEOUT);
> > +
> > +	kfree(dmabuf);
> > +
> > +	if (result < 0) {
> > +		dev_err(&port->dev, "failed to set special chars: %d\n", result);
> > +		return result;
> > +	}
> 
> This is an "open coded" usb_control_msg_send() call :)

Right, but there are a few more functions like this one in this driver
so I kept it for consistency for now.

> Other than that minor thing:
> 
> Reviewed-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

Thanks for reviewing all of these. Now applied.

Johan



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux