V4L/DVB (12221): gspca - stv06xx-hdcs: Actually update the sensor state
authorErik Andrén <erik.andren@gmail.com>
Tue, 23 Jun 2009 15:22:48 +0000 (12:22 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 24 Jul 2009 17:03:21 +0000 (14:03 -0300)
Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c

index 3039ec208f3a5e37c029cc44876642eb0611867f..ec7f5536a8ad71c86b4b90b7d4f12d82be7832da 100644 (file)
@@ -174,7 +174,9 @@ static int hdcs_set_state(struct sd *sd, enum hdcs_power_state state)
        }
 
        ret = stv06xx_write_sensor(sd, HDCS_REG_CONTROL(sd), val);
-       if (ret < 0)
+
+       /* Update the state if the write succeeded */
+       if (!ret)
                hdcs->state = state;
 
        return ret;