From: Michael Grzeschik <m.grzeschik@pengutronix.de>
To: linux-media@vger.kernel.org
Cc: g.liakhovetski@gmx.de, Michael Grzeschik <m.grzeschik@pengutronix.de>
Subject: [PATCH 1/5] mt9m111: set inital return values to zero
Date: Tue, 12 Jul 2011 17:39:02 +0200 [thread overview]
Message-ID: <1310485146-27759-1-git-send-email-m.grzeschik@pengutronix.de> (raw)
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
drivers/media/video/mt9m111.c | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c
index ebebed9..f10dcf0 100644
--- a/drivers/media/video/mt9m111.c
+++ b/drivers/media/video/mt9m111.c
@@ -190,7 +190,7 @@ static struct mt9m111 *to_mt9m111(const struct i2c_client *client)
static int reg_page_map_set(struct i2c_client *client, const u16 reg)
{
- int ret;
+ int ret = 0;
u16 page;
static int lastpage = -1; /* PageMap cache value */
@@ -208,7 +208,7 @@ static int reg_page_map_set(struct i2c_client *client, const u16 reg)
static int mt9m111_reg_read(struct i2c_client *client, const u16 reg)
{
- int ret;
+ int ret = 0;
ret = reg_page_map_set(client, reg);
if (!ret)
@@ -221,7 +221,7 @@ static int mt9m111_reg_read(struct i2c_client *client, const u16 reg)
static int mt9m111_reg_write(struct i2c_client *client, const u16 reg,
const u16 data)
{
- int ret;
+ int ret = 0;
ret = reg_page_map_set(client, reg);
if (!ret)
@@ -234,7 +234,7 @@ static int mt9m111_reg_write(struct i2c_client *client, const u16 reg,
static int mt9m111_reg_set(struct i2c_client *client, const u16 reg,
const u16 data)
{
- int ret;
+ int ret = 0;
ret = mt9m111_reg_read(client, reg);
if (ret >= 0)
@@ -245,7 +245,7 @@ static int mt9m111_reg_set(struct i2c_client *client, const u16 reg,
static int mt9m111_reg_clear(struct i2c_client *client, const u16 reg,
const u16 data)
{
- int ret;
+ int ret = 0;
ret = mt9m111_reg_read(client, reg);
return mt9m111_reg_write(client, reg, ret & ~data);
@@ -387,7 +387,7 @@ static int mt9m111_setfmt_yuv(struct i2c_client *client)
static int mt9m111_enable(struct i2c_client *client)
{
struct mt9m111 *mt9m111 = to_mt9m111(client);
- int ret;
+ int ret = 0;
ret = reg_set(RESET, MT9M111_RESET_CHIP_ENABLE);
if (!ret)
@@ -397,7 +397,7 @@ static int mt9m111_enable(struct i2c_client *client)
static int mt9m111_reset(struct i2c_client *client)
{
- int ret;
+ int ret = 0;
ret = reg_set(RESET, MT9M111_RESET_RESET_MODE);
if (!ret)
@@ -452,7 +452,7 @@ static int mt9m111_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
struct v4l2_rect rect = a->c;
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct mt9m111 *mt9m111 = to_mt9m111(client);
- int ret;
+ int ret = 0;
dev_dbg(&client->dev, "%s left=%d, top=%d, width=%d, height=%d\n",
__func__, rect.left, rect.top, rect.width, rect.height);
@@ -568,7 +568,7 @@ static int mt9m111_s_fmt(struct v4l2_subdev *sd,
.width = mf->width,
.height = mf->height,
};
- int ret;
+ int ret = 0;
fmt = mt9m111_find_datafmt(mf->code, mt9m111_colour_fmts,
ARRAY_SIZE(mt9m111_colour_fmts));
@@ -741,7 +741,7 @@ static struct soc_camera_ops mt9m111_ops = {
static int mt9m111_set_flip(struct i2c_client *client, int flip, int mask)
{
struct mt9m111 *mt9m111 = to_mt9m111(client);
- int ret;
+ int ret = 0;
if (mt9m111->context == HIGHPOWER) {
if (flip)
@@ -791,7 +791,7 @@ static int mt9m111_set_global_gain(struct i2c_client *client, int gain)
static int mt9m111_set_autoexposure(struct i2c_client *client, int on)
{
struct mt9m111 *mt9m111 = to_mt9m111(client);
- int ret;
+ int ret = 0;
if (on)
ret = reg_set(OPER_MODE_CTRL, MT9M111_OPMODE_AUTOEXPO_EN);
@@ -807,7 +807,7 @@ static int mt9m111_set_autoexposure(struct i2c_client *client, int on)
static int mt9m111_set_autowhitebalance(struct i2c_client *client, int on)
{
struct mt9m111 *mt9m111 = to_mt9m111(client);
- int ret;
+ int ret = 0;
if (on)
ret = reg_set(OPER_MODE_CTRL, MT9M111_OPMODE_AUTOWHITEBAL_EN);
@@ -868,7 +868,7 @@ static int mt9m111_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct mt9m111 *mt9m111 = to_mt9m111(client);
const struct v4l2_queryctrl *qctrl;
- int ret;
+ int ret = 0;
qctrl = soc_camera_find_qctrl(&mt9m111_ops, ctrl->id);
if (!qctrl)
@@ -945,7 +945,7 @@ static int mt9m111_resume(struct soc_camera_device *icd)
static int mt9m111_init(struct i2c_client *client)
{
struct mt9m111 *mt9m111 = to_mt9m111(client);
- int ret;
+ int ret = 0;
mt9m111->context = HIGHPOWER;
ret = mt9m111_enable(client);
@@ -969,7 +969,7 @@ static int mt9m111_video_probe(struct soc_camera_device *icd,
{
struct mt9m111 *mt9m111 = to_mt9m111(client);
s32 data;
- int ret;
+ int ret = 0;
/*
* We must have a parent by now. And it cannot be a wrong one.
@@ -1053,7 +1053,7 @@ static int mt9m111_probe(struct i2c_client *client,
struct soc_camera_device *icd = client->dev.platform_data;
struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
struct soc_camera_link *icl;
- int ret;
+ int ret = 0;
if (!icd) {
dev_err(&client->dev, "mt9m111: soc-camera data missing!\n");
--
1.7.5.4
next reply other threads:[~2011-07-12 15:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-12 15:39 Michael Grzeschik [this message]
2011-07-12 15:39 ` [PATCH 2/5] mt9m111: fix missing return value check mt9m111_reg_clear Michael Grzeschik
2011-07-17 16:54 ` Guennadi Liakhovetski
2011-07-12 15:39 ` [PATCH 3/5] mt9m111: move lastpage to struct mt9m111 for multi instances Michael Grzeschik
2011-07-14 15:27 ` Laurent Pinchart
2011-07-17 16:53 ` Guennadi Liakhovetski
2011-07-19 13:26 ` [PATCH v2] " Michael Grzeschik
2011-07-19 14:10 ` Guennadi Liakhovetski
2011-07-12 15:39 ` [PATCH v4 4/5] mt9m111: rewrite set_pixfmt Michael Grzeschik
2011-07-17 17:09 ` Guennadi Liakhovetski
2011-07-22 11:57 ` Michael Grzeschik
2011-07-12 15:39 ` [PATCH 5/5] mt9m111: make use of testpattern Michael Grzeschik
2011-07-17 16:55 ` Guennadi Liakhovetski
2011-07-14 15:25 ` [PATCH 1/5] mt9m111: set inital return values to zero Laurent Pinchart
2011-07-17 16:52 ` Guennadi Liakhovetski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1310485146-27759-1-git-send-email-m.grzeschik@pengutronix.de \
--to=m.grzeschik@pengutronix.de \
--cc=g.liakhovetski@gmx.de \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.