aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/tty/serial/max310x.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index 8dec480a73df..5836168414e4 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -876,6 +876,7 @@ static void max310x_set_termios(struct uart_port *port,
876static int max310x_ioctl(struct uart_port *port, unsigned int cmd, 876static int max310x_ioctl(struct uart_port *port, unsigned int cmd,
877 unsigned long arg) 877 unsigned long arg)
878{ 878{
879#if defined(TIOCSRS485) && defined(TIOCGRS485)
879 struct serial_rs485 rs485; 880 struct serial_rs485 rs485;
880 unsigned int val; 881 unsigned int val;
881 882
@@ -903,7 +904,7 @@ static int max310x_ioctl(struct uart_port *port, unsigned int cmd,
903 max310x_port_update(port, MAX310X_MODE2_REG, 904 max310x_port_update(port, MAX310X_MODE2_REG,
904 MAX310X_MODE2_ECHOSUPR_BIT, 0); 905 MAX310X_MODE2_ECHOSUPR_BIT, 0);
905 } 906 }
906 break; 907 return 0;
907 case TIOCGRS485: 908 case TIOCGRS485:
908 memset(&rs485, 0, sizeof(rs485)); 909 memset(&rs485, 0, sizeof(rs485));
909 val = max310x_port_read(port, MAX310X_MODE1_REG); 910 val = max310x_port_read(port, MAX310X_MODE1_REG);
@@ -916,12 +917,13 @@ static int max310x_ioctl(struct uart_port *port, unsigned int cmd,
916 if (copy_to_user((struct serial_rs485 *)arg, &rs485, 917 if (copy_to_user((struct serial_rs485 *)arg, &rs485,
917 sizeof(rs485))) 918 sizeof(rs485)))
918 return -EFAULT; 919 return -EFAULT;
919 break; 920 return 0;
920 default: 921 default:
921 return -ENOIOCTLCMD; 922 break;
922 } 923 }
924#endif
923 925
924 return 0; 926 return -ENOIOCTLCMD;
925} 927}
926 928
927static int max310x_startup(struct uart_port *port) 929static int max310x_startup(struct uart_port *port)