From a74c472ed86a609ce4892e06fb0174788579da39 Mon Sep 17 00:00:00 2001 From: "R. Steve McKown" Date: Mon, 17 May 2010 15:48:31 -0600 Subject: [PATCH] Remove unnecessary #if's --- src/cp210x.c | 16 +++------------- src/cp210x.c.karmic | 16 +++------------- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/src/cp210x.c b/src/cp210x.c index d1fbf26..81e2e91 100644 --- a/src/cp210x.c +++ b/src/cp210x.c @@ -321,16 +321,10 @@ static int cp210x_reset(struct usb_serial_port *port) { dbg("%s", __FUNCTION__); -#if 1 - /* Is this better than usb_device_reset? It may be. Once a client - * issues the reset ioctl, it must disconnect and reconnect, since the - * USB connections are torn down. We also ignore the error return, - * since the part resets and doesn't send one... + /* Instructing the CP210X to reset seems to work more reliably than + * calling usb_reset_device(). */ cp210x_ctlmsg(port, 0xff, 0x40, 0x0008, 0x00, NULL, 0); -#else - usb_reset_device(port->serial->dev); -#endif return 0; } @@ -445,13 +439,9 @@ static int cp210x_portconfset(struct usb_serial_port *port, lconfig.reset.latch = cpu_to_be16(config->reset.latch); lconfig.suspend.mode = cpu_to_be16(config->suspend.mode); lconfig.suspend.latch = cpu_to_be16(config->suspend.latch); -#if 0 /* apparently not implemented by CP210X firmware */ - lconfig.reset.lowPower = cpu_to_be16(config->reset.lowPower); - lconfig.suspend.lowPower = cpu_to_be16(config->suspend.lowPower); -#else + /* apparently not implemented by CP210X firmware */ lconfig.suspend.lowPower = 0; lconfig.reset.lowPower = 0; -#endif ret = cp210x_ctlmsg(port, 0xff, 0x40, 0x370c, 0, &lconfig, sizeof(struct cp210x_port_config)); diff --git a/src/cp210x.c.karmic b/src/cp210x.c.karmic index 267ff4c..84d1b93 100644 --- a/src/cp210x.c.karmic +++ b/src/cp210x.c.karmic @@ -342,16 +342,10 @@ static int cp210x_reset(struct usb_serial_port *port) { dbg("%s", __func__); -#if 1 - /* Is this better than usb_device_reset? It may be. Once a client - * issues the reset ioctl, it must disconnect and reconnect, since the - * USB connections are torn down. We also ignore the error return, - * since the part resets and doesn't send one... + /* Instructing the CP210X to reset seems to work more reliably than + * calling usb_reset_device(). */ cp210x_ctlmsg(port, 0xff, 0x40, 0x0008, 0x00, NULL, 0); -#else - usb_reset_device(port->serial->dev); -#endif return 0; } @@ -466,13 +460,9 @@ static int cp210x_portconfset(struct usb_serial_port *port, lconfig.reset.latch = cpu_to_be16(config->reset.latch); lconfig.suspend.mode = cpu_to_be16(config->suspend.mode); lconfig.suspend.latch = cpu_to_be16(config->suspend.latch); -#if 0 /* apparently not implemented by CP210X firmware */ - lconfig.reset.lowPower = cpu_to_be16(config->reset.lowPower); - lconfig.suspend.lowPower = cpu_to_be16(config->suspend.lowPower); -#else + /* apparently not implemented by CP210X firmware */ lconfig.suspend.lowPower = 0; lconfig.reset.lowPower = 0; -#endif ret = cp210x_ctlmsg(port, 0xff, 0x40, 0x370c, 0, &lconfig, sizeof(struct cp210x_port_config)); -- 2.39.2