Re: [PATCH RESEND] max3100 driver

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

 



On Dec 28 2007 14:01, [email protected] wrote:
>+
>+ * The initial minor number is 128 to prevent clashes with ttyS:
>+ * mknod /dev/ttyMAX0 c 4 128
>+ */

[4:128] is taken by ttyS64. Please look into Documentation/devices.txt.

>+struct max3100_port_s {
>+	struct uart_port port;
>+	struct spi_device *spi;
>+	struct tty_struct 	*tty;
>+
>+	struct mutex   spi_txrx;/* protects access to the hw */
>+
>+	int rts;		/* rts status, can be MAX3100_RTS or 0 */

possibly be bool then, if it only takes on two values?

>+	int conf;		/* configuration for the MAX31000
>+				 * (bits 0-7, bits 8-11 are irqs) */
>+	int last_cts_rx;	/* last CTS received for flow ctrl */
>+
>+	int tx_buf_cur;	        /* current char to tx */
>+	int tx_buf_tot;		/* current number of chars in tx buf */

Probably unsigned?

>+static int max3100_do_parity(struct max3100_port_s *s, u16 c)
>+{
>+	int parity;
>+	int i, n;
>+
>+	if (s->parity & MAX3100_PARITY_ODD)
>+		parity = 0;
>+	else
>+		parity = 1;

Or
	parity = !!(s->parity & MAX3100_PARITY_ODD);
	n = (s->parity & MAX3100_7BIT) ? 7 : 8;
(up to you)

>+	for (i = 0; i < n; i++)
>+		parity = parity ^ ((c>>i) & 1);

		parity ^= (c >> i) & 1;

>+	return parity;
>+}
>+
>+	if (s->loopback) {
>+		if ((tx & MAX3100_CMD) == MAX3100_RC)
>+			tx |= 1;
>+	}

	if (s->loopback && (tx & MAX3100_CMD) == MAX3100_RC)
		tx |= 1;

>+MODULE_DESCRIPTION("MAX3100 driver");
>+MODULE_LICENSE("GPL");

I notice a steep increase in serial drivers. Everyone got their
new chips for xmas, eh? :)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux