On Sun, Nov 10, 2013 at 05:58:15PM +0100, Andrew Lunn wrote:
> > > +static int mxuport_dtr(struct usb_serial_port *port, int on)
> > > +{
> > > + struct mxuport_port *mxport = usb_get_serial_port_data(port);
> > > + int err;
> > > +
> > > + mutex_lock(&mxport->mutex);
> > > +
> > > + if (on)
> > > +         mxport->mcr_state |= UART_MCR_DTR;
> > > + else
> > > +         mxport->mcr_state &= ~UART_MCR_DTR;
> > > +
> > > + err = mxuport_set_mcr(port, mxport->mcr_state);
> > > +
> > > + mutex_unlock(&mxport->mutex);
> > > +
> > > + return err;
> > > +}
> > 
> > You should probably use SET_DTR (and rename the function
> > mxuport_set_dtr).
> 
> I considered mxuport_set_dtr(), but it does not really fit with the
> usb-serial naming. tty_port_operations has dtr_rts, not set_dtr_rts.
> usb_serial_driver also has dtr_rts, not set_dtr_rts.

You're right about that, but the tty (usb-serial) operation can remain
the oddly named one. I still prefer that the local helpers have more
descriptive names, and muport_set_dtr and mxuport_set_rts would also be
consistent with mxuport_set_mcr.

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

Reply via email to