Commit 0a7a1345 authored by Hugues Fruchet's avatar Hugues Fruchet Committed by Mauro Carvalho Chehab

media: ov9650: fix coding style

Fix a bunch of coding style issues detected
by checkpatch --strict.
Signed-off-by: default avatarHugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 1a48e102
...@@ -484,6 +484,7 @@ static int ov965x_set_default_gamma_curve(struct ov965x *ov965x) ...@@ -484,6 +484,7 @@ static int ov965x_set_default_gamma_curve(struct ov965x *ov965x)
for (i = 0; i < ARRAY_SIZE(gamma_curve); i++) { for (i = 0; i < ARRAY_SIZE(gamma_curve); i++) {
int ret = ov965x_write(ov965x->client, addr, gamma_curve[i]); int ret = ov965x_write(ov965x->client, addr, gamma_curve[i]);
if (ret < 0) if (ret < 0)
return ret; return ret;
addr++; addr++;
...@@ -503,6 +504,7 @@ static int ov965x_set_color_matrix(struct ov965x *ov965x) ...@@ -503,6 +504,7 @@ static int ov965x_set_color_matrix(struct ov965x *ov965x)
for (i = 0; i < ARRAY_SIZE(mtx); i++) { for (i = 0; i < ARRAY_SIZE(mtx); i++) {
int ret = ov965x_write(ov965x->client, addr, mtx[i]); int ret = ov965x_write(ov965x->client, addr, mtx[i]);
if (ret < 0) if (ret < 0)
return ret; return ret;
addr++; addr++;
...@@ -611,7 +613,7 @@ static int ov965x_set_banding_filter(struct ov965x *ov965x, int value) ...@@ -611,7 +613,7 @@ static int ov965x_set_banding_filter(struct ov965x *ov965x, int value)
} }
if (value == V4L2_CID_POWER_LINE_FREQUENCY_DISABLED) if (value == V4L2_CID_POWER_LINE_FREQUENCY_DISABLED)
return 0; return 0;
if (WARN_ON(ov965x->fiv == NULL)) if (WARN_ON(!ov965x->fiv))
return -EINVAL; return -EINVAL;
/* Set minimal exposure time for 50/60 HZ lighting */ /* Set minimal exposure time for 50/60 HZ lighting */
if (value == V4L2_CID_POWER_LINE_FREQUENCY_50HZ) if (value == V4L2_CID_POWER_LINE_FREQUENCY_50HZ)
...@@ -1006,9 +1008,11 @@ static int ov965x_initialize_controls(struct ov965x *ov965x) ...@@ -1006,9 +1008,11 @@ static int ov965x_initialize_controls(struct ov965x *ov965x)
ctrls->red_balance = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_RED_BALANCE, ctrls->red_balance = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_RED_BALANCE,
0, 0xff, 1, 0x80); 0, 0xff, 1, 0x80);
/* Auto/manual exposure */ /* Auto/manual exposure */
ctrls->auto_exp = v4l2_ctrl_new_std_menu(hdl, ops, ctrls->auto_exp =
v4l2_ctrl_new_std_menu(hdl, ops,
V4L2_CID_EXPOSURE_AUTO, V4L2_CID_EXPOSURE_AUTO,
V4L2_EXPOSURE_MANUAL, 0, V4L2_EXPOSURE_AUTO); V4L2_EXPOSURE_MANUAL, 0,
V4L2_EXPOSURE_AUTO);
/* Exposure time, in 100 us units. min/max is updated dynamically. */ /* Exposure time, in 100 us units. min/max is updated dynamically. */
ctrls->exposure = v4l2_ctrl_new_std(hdl, ops, ctrls->exposure = v4l2_ctrl_new_std(hdl, ops,
V4L2_CID_EXPOSURE_ABSOLUTE, V4L2_CID_EXPOSURE_ABSOLUTE,
...@@ -1029,7 +1033,8 @@ static int ov965x_initialize_controls(struct ov965x *ov965x) ...@@ -1029,7 +1033,8 @@ static int ov965x_initialize_controls(struct ov965x *ov965x)
ctrls->hflip = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_HFLIP, 0, 1, 1, 0); ctrls->hflip = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_HFLIP, 0, 1, 1, 0);
ctrls->vflip = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_VFLIP, 0, 1, 1, 0); ctrls->vflip = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_VFLIP, 0, 1, 1, 0);
ctrls->light_freq = v4l2_ctrl_new_std_menu(hdl, ops, ctrls->light_freq =
v4l2_ctrl_new_std_menu(hdl, ops,
V4L2_CID_POWER_LINE_FREQUENCY, V4L2_CID_POWER_LINE_FREQUENCY,
V4L2_CID_POWER_LINE_FREQUENCY_60HZ, ~0x7, V4L2_CID_POWER_LINE_FREQUENCY_60HZ, ~0x7,
V4L2_CID_POWER_LINE_FREQUENCY_50HZ); V4L2_CID_POWER_LINE_FREQUENCY_50HZ);
...@@ -1121,7 +1126,6 @@ static int __ov965x_set_frame_interval(struct ov965x *ov965x, ...@@ -1121,7 +1126,6 @@ static int __ov965x_set_frame_interval(struct ov965x *ov965x,
u64 req_int, err, min_err = ~0ULL; u64 req_int, err, min_err = ~0ULL;
unsigned int i; unsigned int i;
if (fi->interval.denominator == 0) if (fi->interval.denominator == 0)
return -EINVAL; return -EINVAL;
...@@ -1165,7 +1169,8 @@ static int ov965x_s_frame_interval(struct v4l2_subdev *sd, ...@@ -1165,7 +1169,8 @@ static int ov965x_s_frame_interval(struct v4l2_subdev *sd,
return ret; return ret;
} }
static int ov965x_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg, static int ov965x_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct ov965x *ov965x = to_ov965x(sd); struct ov965x *ov965x = to_ov965x(sd);
...@@ -1209,7 +1214,8 @@ static void __ov965x_try_frame_size(struct v4l2_mbus_framefmt *mf, ...@@ -1209,7 +1214,8 @@ static void __ov965x_try_frame_size(struct v4l2_mbus_framefmt *mf,
*size = match; *size = match;
} }
static int ov965x_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg, static int ov965x_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
unsigned int index = ARRAY_SIZE(ov965x_formats); unsigned int index = ARRAY_SIZE(ov965x_formats);
...@@ -1231,7 +1237,7 @@ static int ov965x_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config ...@@ -1231,7 +1237,7 @@ static int ov965x_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config
mutex_lock(&ov965x->lock); mutex_lock(&ov965x->lock);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
if (cfg != NULL) { if (cfg) {
mf = v4l2_subdev_get_try_format(sd, cfg, fmt->pad); mf = v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
*mf = fmt->format; *mf = fmt->format;
} }
...@@ -1362,7 +1368,8 @@ static int ov965x_s_stream(struct v4l2_subdev *sd, int on) ...@@ -1362,7 +1368,8 @@ static int ov965x_s_stream(struct v4l2_subdev *sd, int on)
*/ */
static int ov965x_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) static int ov965x_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ {
struct v4l2_mbus_framefmt *mf = v4l2_subdev_get_try_format(sd, fh->pad, 0); struct v4l2_mbus_framefmt *mf =
v4l2_subdev_get_try_format(sd, fh->pad, 0);
ov965x_get_default_format(mf); ov965x_get_default_format(mf);
return 0; return 0;
...@@ -1470,7 +1477,7 @@ static int ov965x_probe(struct i2c_client *client, ...@@ -1470,7 +1477,7 @@ static int ov965x_probe(struct i2c_client *client,
struct ov965x *ov965x; struct ov965x *ov965x;
int ret; int ret;
if (pdata == NULL) { if (!pdata) {
dev_err(&client->dev, "platform data not specified\n"); dev_err(&client->dev, "platform data not specified\n");
return -EINVAL; return -EINVAL;
} }
......
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