Commit cb5fd12a authored by Joe Perches's avatar Joe Perches Committed by Mauro Carvalho Chehab

media: tw9910: Miscellaneous neatening

Yet more whitespace and style neatening

o Add blank lines before returns
o Reverse a logic test and return early on error
o Move formats to same line as dev_<level> calls
o Remove an unnecessary period from a logging message
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent d6fdad55
...@@ -740,6 +740,7 @@ static int tw9910_get_selection(struct v4l2_subdev *sd, ...@@ -740,6 +740,7 @@ static int tw9910_get_selection(struct v4l2_subdev *sd,
sel->r.width = 768; sel->r.width = 768;
sel->r.height = 576; sel->r.height = 576;
} }
return 0; return 0;
} }
...@@ -785,11 +786,13 @@ static int tw9910_s_fmt(struct v4l2_subdev *sd, ...@@ -785,11 +786,13 @@ static int tw9910_s_fmt(struct v4l2_subdev *sd,
mf->colorspace = V4L2_COLORSPACE_SMPTE170M; mf->colorspace = V4L2_COLORSPACE_SMPTE170M;
ret = tw9910_set_frame(sd, &width, &height); ret = tw9910_set_frame(sd, &width, &height);
if (!ret) { if (ret)
mf->width = width; return ret;
mf->height = height;
} mf->width = width;
return ret; mf->height = height;
return 0;
} }
static int tw9910_set_fmt(struct v4l2_subdev *sd, static int tw9910_set_fmt(struct v4l2_subdev *sd,
...@@ -807,7 +810,7 @@ static int tw9910_set_fmt(struct v4l2_subdev *sd, ...@@ -807,7 +810,7 @@ static int tw9910_set_fmt(struct v4l2_subdev *sd,
if (mf->field == V4L2_FIELD_ANY) { if (mf->field == V4L2_FIELD_ANY) {
mf->field = V4L2_FIELD_INTERLACED_BT; mf->field = V4L2_FIELD_INTERLACED_BT;
} else if (mf->field != V4L2_FIELD_INTERLACED_BT) { } else if (mf->field != V4L2_FIELD_INTERLACED_BT) {
dev_err(&client->dev, "Field type %d invalid.\n", mf->field); dev_err(&client->dev, "Field type %d invalid\n", mf->field);
return -EINVAL; return -EINVAL;
} }
...@@ -824,7 +827,9 @@ static int tw9910_set_fmt(struct v4l2_subdev *sd, ...@@ -824,7 +827,9 @@ static int tw9910_set_fmt(struct v4l2_subdev *sd,
if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE)
return tw9910_s_fmt(sd, mf); return tw9910_s_fmt(sd, mf);
cfg->try_fmt = *mf; cfg->try_fmt = *mf;
return 0; return 0;
} }
...@@ -853,21 +858,21 @@ static int tw9910_video_probe(struct i2c_client *client) ...@@ -853,21 +858,21 @@ static int tw9910_video_probe(struct i2c_client *client)
id = GET_ID(id); id = GET_ID(id);
if (id != 0x0b || priv->revision > 0x01) { if (id != 0x0b || priv->revision > 0x01) {
dev_err(&client->dev, dev_err(&client->dev, "Product ID error %x:%x\n",
"Product ID error %x:%x\n",
id, priv->revision); id, priv->revision);
ret = -ENODEV; ret = -ENODEV;
goto done; goto done;
} }
dev_info(&client->dev, dev_info(&client->dev, "tw9910 Product ID %0x:%0x\n",
"tw9910 Product ID %0x:%0x\n", id, priv->revision); id, priv->revision);
priv->norm = V4L2_STD_NTSC; priv->norm = V4L2_STD_NTSC;
priv->scale = &tw9910_ntsc_scales[0]; priv->scale = &tw9910_ntsc_scales[0];
done: done:
tw9910_s_power(&priv->subdev, 0); tw9910_s_power(&priv->subdev, 0);
return ret; return ret;
} }
...@@ -887,12 +892,14 @@ static int tw9910_enum_mbus_code(struct v4l2_subdev *sd, ...@@ -887,12 +892,14 @@ static int tw9910_enum_mbus_code(struct v4l2_subdev *sd,
return -EINVAL; return -EINVAL;
code->code = MEDIA_BUS_FMT_UYVY8_2X8; code->code = MEDIA_BUS_FMT_UYVY8_2X8;
return 0; return 0;
} }
static int tw9910_g_tvnorms(struct v4l2_subdev *sd, v4l2_std_id *norm) static int tw9910_g_tvnorms(struct v4l2_subdev *sd, v4l2_std_id *norm)
{ {
*norm = V4L2_STD_NTSC | V4L2_STD_PAL; *norm = V4L2_STD_NTSC | V4L2_STD_PAL;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment