summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c
diff options
context:
space:
mode:
authorErik Andr?n <erik.andren@gmail.com>2008-12-27 16:28:00 +0100
committerErik Andr?n <erik.andren@gmail.com>2008-12-27 16:28:00 +0100
commit9bb669dba4b0c284e2aefe88babb1649a7b12c84 (patch)
tree7a9adffe4df4dfd53363a937e11113c952940028 /linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c
parentcc99e0915696cc281889cbff60b3693074c0a105 (diff)
downloadmediapointer-dvb-s2-9bb669dba4b0c284e2aefe88babb1649a7b12c84.tar.gz
mediapointer-dvb-s2-9bb669dba4b0c284e2aefe88babb1649a7b12c84.tar.bz2
gspca - m5602: Simplify error handling
From: Erik Andr?n <erik.andren@gmail.com> Simplfy error handling by replacing goto statements with return equivalents. Priority: normal Signed-off-by: Erik Andr?n <erik.andren@gmail.com>
Diffstat (limited to 'linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c')
-rw-r--r--linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c b/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c
index c0e71c331..f3e9d8f0e 100644
--- a/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c
+++ b/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c
@@ -125,16 +125,15 @@ int mt9m111_set_vflip(struct gspca_dev *gspca_dev, __s32 val)
/* Set the correct page map */
err = m5602_write_sensor(sd, MT9M111_PAGE_MAP, data, 2);
if (err < 0)
- goto out;
+ return err;
err = m5602_read_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, data, 2);
if (err < 0)
- goto out;
+ return err;
data[0] = (data[0] & 0xfe) | val;
err = m5602_write_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B,
data, 2);
-out:
return err;
}
@@ -163,16 +162,15 @@ int mt9m111_set_hflip(struct gspca_dev *gspca_dev, __s32 val)
/* Set the correct page map */
err = m5602_write_sensor(sd, MT9M111_PAGE_MAP, data, 2);
if (err < 0)
- goto out;
+ return err;
err = m5602_read_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, data, 2);
if (err < 0)
- goto out;
+ return err;
data[0] = (data[0] & 0xfd) | ((val << 1) & 0x02);
err = m5602_write_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B,
data, 2);
-out:
return err;
}
@@ -204,7 +202,7 @@ int mt9m111_set_gain(struct gspca_dev *gspca_dev, __s32 val)
/* Set the correct page map */
err = m5602_write_sensor(sd, MT9M111_PAGE_MAP, data, 2);
if (err < 0)
- goto out;
+ return err;
if (val >= INITIAL_MAX_GAIN * 2 * 2 * 2)
return -EINVAL;
@@ -229,7 +227,7 @@ int mt9m111_set_gain(struct gspca_dev *gspca_dev, __s32 val)
err = m5602_write_sensor(sd, MT9M111_SC_GLOBAL_GAIN,
data, 2);
-out:
+
return err;
}