> This patch allow the users of the 8250 infrastructure to define a > handler for RS485 configration. This feels to me like the right code in the wrong place. > If no handler is defined the 8250 driver will work as usual. Is there any reasons we can't have uart_ops.rs485_config and the RS485 ioctl logic in the serial_core, or even push rs485_get/put into the tty ioctl handler and tty ops so it's not duplicated everywhere ? > + switch (cmd) { > + case TIOCSRS485: > + if (copy_from_user(&rs485_config, (void __user *)arg, > + sizeof(rs485_config))) > + return -EFAULT; > + > + ret = up->rs485_config(up, &rs485_config); > + if (ret) > + return ret; > + > + memcpy(&up->rs485, &rs485_config, sizeof(rs485_config)); > + > + return 0; > + case TIOCGRS485: > + if (copy_to_user((void __user *)arg, &up->rs485, > + sizeof(up->rs485))) > + return -EFAULT; > + return 0; Possibly your mutex needs to cover parallel get an set, but then again anyone doing that may well deserve what they get 8) Alan -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html