Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a0f43e9 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds
Browse files

tty-usb-pl2303: Coding style

parent acc80758
Loading
Loading
Loading
Loading
+36 −28
Original line number Diff line number Diff line
@@ -10,7 +10,8 @@
 *	modify it under the terms of the GNU General Public License version
 *	2 as published by the Free Software Foundation.
 *
 * See Documentation/usb/usb-serial.txt for more information on using this driver
 * See Documentation/usb/usb-serial.txt for more information on using this
 * driver
 *
 */

@@ -25,7 +26,7 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/spinlock.h>
#include <asm/uaccess.h>
#include <linux/uaccess.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include "pl2303.h"
@@ -222,7 +223,7 @@ static unsigned int pl2303_buf_data_avail(struct pl2303_buf *pb)
	if (pb == NULL)
		return 0;

	return ((pb->buf_size + pb->buf_put - pb->buf_get) % pb->buf_size);
	return (pb->buf_size + pb->buf_put - pb->buf_get) % pb->buf_size;
}

/*
@@ -236,7 +237,7 @@ static unsigned int pl2303_buf_space_avail(struct pl2303_buf *pb)
	if (pb == NULL)
		return 0;

	return ((pb->buf_size + pb->buf_get - pb->buf_put - 1) % pb->buf_size);
	return (pb->buf_size + pb->buf_get - pb->buf_put - 1) % pb->buf_size;
}

/*
@@ -452,7 +453,7 @@ static void pl2303_send(struct usb_serial_port *port)
		dev_err(&port->dev, "%s - failed submitting write urb,"
			" error %d\n", __func__, result);
		priv->write_urb_in_use = 0;
		// TODO: reschedule pl2303_send
		/* TODO: reschedule pl2303_send */
	}

	usb_serial_port_softint(port);
@@ -561,11 +562,19 @@ static void pl2303_set_termios(struct tty_struct *tty,

	if (cflag & CSIZE) {
		switch (cflag & CSIZE) {
			case CS5:	buf[6] = 5;	break;
			case CS6:	buf[6] = 6;	break;
			case CS7:	buf[6] = 7;	break;
		case CS5:
			buf[6] = 5;
			break;
		case CS6:
			buf[6] = 6;
			break;
		case CS7:
			buf[6] = 7;
			break;
		default:
			case CS8:	buf[6] = 8;	break;
		case CS8:
			buf[6] = 8;
			break;
		}
		dbg("%s - data bits = %d", __func__, buf[6]);
	}
@@ -740,7 +749,7 @@ static int pl2303_open(struct tty_struct *tty,
	if (tty)
		pl2303_set_termios(tty, port, &tmp_termios);

	//FIXME: need to assert RTS and DTR if CRTSCTS off
	/* FIXME: need to assert RTS and DTR if CRTSCTS off */

	dbg("%s - submitting read urb", __func__);
	port->read_urb->dev = serial->dev;
@@ -867,12 +876,10 @@ static int pl2303_ioctl(struct tty_struct *tty, struct file *file,
	case TIOCMIWAIT:
		dbg("%s (%d) TIOCMIWAIT", __func__,  port->number);
		return wait_modem_info(port, arg);

	default:
		dbg("%s not supported = 0x%04x", __func__, cmd);
		break;
	}

	return -ENOIOCTLCMD;
}

@@ -889,7 +896,8 @@ static void pl2303_break_ctl(struct tty_struct *tty, int break_state)
		state = BREAK_OFF;
	else
		state = BREAK_ON;
	dbg("%s - turning break %s", __func__, state==BREAK_OFF ? "off" : "on");
	dbg("%s - turning break %s", __func__,
			state == BREAK_OFF ? "off" : "on");

	result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
				 BREAK_REQUEST, BREAK_REQUEST_TYPE, state,