Commit 3ad2e318 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'usb-3.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg Kroah-Hartman:
 "Here are some small USB driver fixes that resolve some reported
  problems for 3.10-rc6

  Nothing major, just 3 USB serial driver fixes, and two chipidea fixes"

* tag 'usb-3.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  usb: chipidea: fix id change handling
  usb: chipidea: fix no transceiver case
  USB: pl2303: fix device initialisation at open
  USB: spcp8x5: fix device initialisation at open
  USB: f81232: fix device initialisation at open
parents a2648ebb 0c3f3dc6
...@@ -276,8 +276,9 @@ static void ci_role_work(struct work_struct *work) ...@@ -276,8 +276,9 @@ static void ci_role_work(struct work_struct *work)
ci_role_stop(ci); ci_role_stop(ci);
ci_role_start(ci, role); ci_role_start(ci, role);
enable_irq(ci->irq);
} }
enable_irq(ci->irq);
} }
static irqreturn_t ci_irq(int irq, void *data) static irqreturn_t ci_irq(int irq, void *data)
......
...@@ -1678,8 +1678,11 @@ static int udc_start(struct ci13xxx *ci) ...@@ -1678,8 +1678,11 @@ static int udc_start(struct ci13xxx *ci)
ci->gadget.ep0 = &ci->ep0in->ep; ci->gadget.ep0 = &ci->ep0in->ep;
if (ci->global_phy) if (ci->global_phy) {
ci->transceiver = usb_get_phy(USB_PHY_TYPE_USB2); ci->transceiver = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR(ci->transceiver))
ci->transceiver = NULL;
}
if (ci->platdata->flags & CI13XXX_REQUIRE_TRANSCEIVER) { if (ci->platdata->flags & CI13XXX_REQUIRE_TRANSCEIVER) {
if (ci->transceiver == NULL) { if (ci->transceiver == NULL) {
...@@ -1694,7 +1697,7 @@ static int udc_start(struct ci13xxx *ci) ...@@ -1694,7 +1697,7 @@ static int udc_start(struct ci13xxx *ci)
goto put_transceiver; goto put_transceiver;
} }
if (!IS_ERR_OR_NULL(ci->transceiver)) { if (ci->transceiver) {
retval = otg_set_peripheral(ci->transceiver->otg, retval = otg_set_peripheral(ci->transceiver->otg,
&ci->gadget); &ci->gadget);
if (retval) if (retval)
...@@ -1711,7 +1714,7 @@ static int udc_start(struct ci13xxx *ci) ...@@ -1711,7 +1714,7 @@ static int udc_start(struct ci13xxx *ci)
return retval; return retval;
remove_trans: remove_trans:
if (!IS_ERR_OR_NULL(ci->transceiver)) { if (ci->transceiver) {
otg_set_peripheral(ci->transceiver->otg, NULL); otg_set_peripheral(ci->transceiver->otg, NULL);
if (ci->global_phy) if (ci->global_phy)
usb_put_phy(ci->transceiver); usb_put_phy(ci->transceiver);
...@@ -1719,7 +1722,7 @@ static int udc_start(struct ci13xxx *ci) ...@@ -1719,7 +1722,7 @@ static int udc_start(struct ci13xxx *ci)
dev_err(dev, "error = %i\n", retval); dev_err(dev, "error = %i\n", retval);
put_transceiver: put_transceiver:
if (!IS_ERR_OR_NULL(ci->transceiver) && ci->global_phy) if (ci->transceiver && ci->global_phy)
usb_put_phy(ci->transceiver); usb_put_phy(ci->transceiver);
destroy_eps: destroy_eps:
destroy_eps(ci); destroy_eps(ci);
...@@ -1747,7 +1750,7 @@ static void udc_stop(struct ci13xxx *ci) ...@@ -1747,7 +1750,7 @@ static void udc_stop(struct ci13xxx *ci)
dma_pool_destroy(ci->td_pool); dma_pool_destroy(ci->td_pool);
dma_pool_destroy(ci->qh_pool); dma_pool_destroy(ci->qh_pool);
if (!IS_ERR_OR_NULL(ci->transceiver)) { if (ci->transceiver) {
otg_set_peripheral(ci->transceiver->otg, NULL); otg_set_peripheral(ci->transceiver->otg, NULL);
if (ci->global_phy) if (ci->global_phy)
usb_put_phy(ci->transceiver); usb_put_phy(ci->transceiver);
......
...@@ -165,11 +165,12 @@ static void f81232_set_termios(struct tty_struct *tty, ...@@ -165,11 +165,12 @@ static void f81232_set_termios(struct tty_struct *tty,
/* FIXME - Stubbed out for now */ /* FIXME - Stubbed out for now */
/* Don't change anything if nothing has changed */ /* Don't change anything if nothing has changed */
if (!tty_termios_hw_change(&tty->termios, old_termios)) if (old_termios && !tty_termios_hw_change(&tty->termios, old_termios))
return; return;
/* Do the real work here... */ /* Do the real work here... */
tty_termios_copy_hw(&tty->termios, old_termios); if (old_termios)
tty_termios_copy_hw(&tty->termios, old_termios);
} }
static int f81232_tiocmget(struct tty_struct *tty) static int f81232_tiocmget(struct tty_struct *tty)
...@@ -187,12 +188,11 @@ static int f81232_tiocmset(struct tty_struct *tty, ...@@ -187,12 +188,11 @@ static int f81232_tiocmset(struct tty_struct *tty,
static int f81232_open(struct tty_struct *tty, struct usb_serial_port *port) static int f81232_open(struct tty_struct *tty, struct usb_serial_port *port)
{ {
struct ktermios tmp_termios;
int result; int result;
/* Setup termios */ /* Setup termios */
if (tty) if (tty)
f81232_set_termios(tty, port, &tmp_termios); f81232_set_termios(tty, port, NULL);
result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
if (result) { if (result) {
......
...@@ -284,7 +284,7 @@ static void pl2303_set_termios(struct tty_struct *tty, ...@@ -284,7 +284,7 @@ static void pl2303_set_termios(struct tty_struct *tty,
serial settings even to the same values as before. Thus serial settings even to the same values as before. Thus
we actually need to filter in this specific case */ we actually need to filter in this specific case */
if (!tty_termios_hw_change(&tty->termios, old_termios)) if (old_termios && !tty_termios_hw_change(&tty->termios, old_termios))
return; return;
cflag = tty->termios.c_cflag; cflag = tty->termios.c_cflag;
...@@ -293,7 +293,8 @@ static void pl2303_set_termios(struct tty_struct *tty, ...@@ -293,7 +293,8 @@ static void pl2303_set_termios(struct tty_struct *tty,
if (!buf) { if (!buf) {
dev_err(&port->dev, "%s - out of memory.\n", __func__); dev_err(&port->dev, "%s - out of memory.\n", __func__);
/* Report back no change occurred */ /* Report back no change occurred */
tty->termios = *old_termios; if (old_termios)
tty->termios = *old_termios;
return; return;
} }
...@@ -433,7 +434,7 @@ static void pl2303_set_termios(struct tty_struct *tty, ...@@ -433,7 +434,7 @@ static void pl2303_set_termios(struct tty_struct *tty,
control = priv->line_control; control = priv->line_control;
if ((cflag & CBAUD) == B0) if ((cflag & CBAUD) == B0)
priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS); priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS);
else if ((old_termios->c_cflag & CBAUD) == B0) else if (old_termios && (old_termios->c_cflag & CBAUD) == B0)
priv->line_control |= (CONTROL_DTR | CONTROL_RTS); priv->line_control |= (CONTROL_DTR | CONTROL_RTS);
if (control != priv->line_control) { if (control != priv->line_control) {
control = priv->line_control; control = priv->line_control;
...@@ -492,7 +493,6 @@ static void pl2303_close(struct usb_serial_port *port) ...@@ -492,7 +493,6 @@ static void pl2303_close(struct usb_serial_port *port)
static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port) static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port)
{ {
struct ktermios tmp_termios;
struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial;
struct pl2303_serial_private *spriv = usb_get_serial_data(serial); struct pl2303_serial_private *spriv = usb_get_serial_data(serial);
int result; int result;
...@@ -508,7 +508,7 @@ static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -508,7 +508,7 @@ static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port)
/* Setup termios */ /* Setup termios */
if (tty) if (tty)
pl2303_set_termios(tty, port, &tmp_termios); pl2303_set_termios(tty, port, NULL);
result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
if (result) { if (result) {
......
...@@ -291,7 +291,6 @@ static void spcp8x5_set_termios(struct tty_struct *tty, ...@@ -291,7 +291,6 @@ static void spcp8x5_set_termios(struct tty_struct *tty,
struct spcp8x5_private *priv = usb_get_serial_port_data(port); struct spcp8x5_private *priv = usb_get_serial_port_data(port);
unsigned long flags; unsigned long flags;
unsigned int cflag = tty->termios.c_cflag; unsigned int cflag = tty->termios.c_cflag;
unsigned int old_cflag = old_termios->c_cflag;
unsigned short uartdata; unsigned short uartdata;
unsigned char buf[2] = {0, 0}; unsigned char buf[2] = {0, 0};
int baud; int baud;
...@@ -299,15 +298,15 @@ static void spcp8x5_set_termios(struct tty_struct *tty, ...@@ -299,15 +298,15 @@ static void spcp8x5_set_termios(struct tty_struct *tty,
u8 control; u8 control;
/* check that they really want us to change something */ /* check that they really want us to change something */
if (!tty_termios_hw_change(&tty->termios, old_termios)) if (old_termios && !tty_termios_hw_change(&tty->termios, old_termios))
return; return;
/* set DTR/RTS active */ /* set DTR/RTS active */
spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&priv->lock, flags);
control = priv->line_control; control = priv->line_control;
if ((old_cflag & CBAUD) == B0) { if (old_termios && (old_termios->c_cflag & CBAUD) == B0) {
priv->line_control |= MCR_DTR; priv->line_control |= MCR_DTR;
if (!(old_cflag & CRTSCTS)) if (!(old_termios->c_cflag & CRTSCTS))
priv->line_control |= MCR_RTS; priv->line_control |= MCR_RTS;
} }
if (control != priv->line_control) { if (control != priv->line_control) {
...@@ -394,7 +393,6 @@ static void spcp8x5_set_termios(struct tty_struct *tty, ...@@ -394,7 +393,6 @@ static void spcp8x5_set_termios(struct tty_struct *tty,
static int spcp8x5_open(struct tty_struct *tty, struct usb_serial_port *port) static int spcp8x5_open(struct tty_struct *tty, struct usb_serial_port *port)
{ {
struct ktermios tmp_termios;
struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial;
struct spcp8x5_private *priv = usb_get_serial_port_data(port); struct spcp8x5_private *priv = usb_get_serial_port_data(port);
int ret; int ret;
...@@ -411,7 +409,7 @@ static int spcp8x5_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -411,7 +409,7 @@ static int spcp8x5_open(struct tty_struct *tty, struct usb_serial_port *port)
spcp8x5_set_ctrl_line(port, priv->line_control); spcp8x5_set_ctrl_line(port, priv->line_control);
if (tty) if (tty)
spcp8x5_set_termios(tty, port, &tmp_termios); spcp8x5_set_termios(tty, port, NULL);
port->port.drain_delay = 256; port->port.drain_delay = 256;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment