Re: [PATCH 2/2] usb-serial: Moxa UPORT 12XX/14XX/16XX driver

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

 



On Tue, May 28, 2013 at 11:08:54PM +0200, Johan Hovold wrote:
> On Tue, May 28, 2013 at 09:41:08PM +0200, Andrew Lunn wrote:
> > On Sun, May 26, 2013 at 06:04:24PM +0200, Johan Hovold wrote:
> > > On Sun, May 26, 2013 at 01:00:51PM +0200, Andrew Lunn wrote:
> > > > +/*
> > > > + * mxuport_write_room
> > > > + *
> > > > + * Return how much space is available in the buffer.
> > > > + */
> > > > +static int mxuport_write_room(struct tty_struct *tty)
> > > > +{
> > > > +	struct usb_serial_port *port = tty->driver_data;
> > > > +	unsigned long flags;
> > > > +	int room;
> > > > +
> > > > +	spin_lock_irqsave(&port->lock, flags);
> > > > +	room = kfifo_avail(&port->write_fifo);
> > > > +	spin_unlock_irqrestore(&port->lock, flags);
> > > > +
> > > > +	dev_dbg(&port->dev, "%s - returns %d\n", __func__, room);
> > > > +	return room;
> > > > +}
> > 
> > ....
> >  
> > > It seems it could be possible to reuse the generic write implementations
> > > of all functions but prepare_write_buffer above rather than the modified
> > > copies.
> > 
> > Hi Johan
> > 
> > If there a reason why usb_serial_generic_write_room() is not exported
> > as a GPL symbol. It looks like i should be able to use it once i sort
> > my 'fake' ports/endpoints out.
> 
> No, I don't think so, but perhaps it should be. Most usb-serial drivers
> still use it. Simply leave the operation unset and usb-serial core will
> set it for you.

Hi Johan

Ah, i fell into the trap. I grep'd for usb_serial_generic_write_room
and did not get any hits. The code is obfusticated/grep unfriendly:

    set_to_generic_if_null(device, write_room);

I will leave it unset.

  Andrew

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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

  Powered by Linux