]> oss.titaniummirror.com Git - cp210x.git/commitdiff
Remove unnecessary #if's
authorR. Steve McKown <rsmckown@gmail.com>
Mon, 17 May 2010 21:48:31 +0000 (15:48 -0600)
committerR. Steve McKown <rsmckown@gmail.com>
Thu, 20 May 2010 01:21:17 +0000 (19:21 -0600)
src/cp210x.c
src/cp210x.c.karmic

index d1fbf26753346a7a4a7351dab590fdac21c3fb07..81e2e9136d4b58a088c6e5fd1511645a942df35c 100644 (file)
@@ -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));
index 267ff4c8b50401b97d1ecc9592ccfc636ebe2d9c..84d1b93d528e4f969600cbc98cb82adac5d57fa5 100644 (file)
@@ -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));