aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/rj54n1cb0c.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-07-30 16:24:54 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-20 23:04:51 -0400
commitc4ce6d14b92aa1772c9d84d068d1b45114fe73cc (patch)
treeb2c492597824d43fad603cc686c3d16b3f766b0c /drivers/media/video/rj54n1cb0c.c
parent401ad27867781c327855025d4becd5bc30fe7e42 (diff)
V4L/DVB: v4l: Use v4l2_get_subdevdata instead of accessing v4l2_subdev::priv
Replace direct access to the v4l2_subdev priv field with the inline v4l2_get_subdevdata method. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/rj54n1cb0c.c')
-rw-r--r--drivers/media/video/rj54n1cb0c.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/media/video/rj54n1cb0c.c b/drivers/media/video/rj54n1cb0c.c
index ce78fff23425..d2fa2d43ff19 100644
--- a/drivers/media/video/rj54n1cb0c.c
+++ b/drivers/media/video/rj54n1cb0c.c
@@ -493,7 +493,7 @@ static int rj54n1_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
493 493
494static int rj54n1_s_stream(struct v4l2_subdev *sd, int enable) 494static int rj54n1_s_stream(struct v4l2_subdev *sd, int enable)
495{ 495{
496 struct i2c_client *client = sd->priv; 496 struct i2c_client *client = v4l2_get_subdevdata(sd);
497 497
498 /* Switch between preview and still shot modes */ 498 /* Switch between preview and still shot modes */
499 return reg_set(client, RJ54N1_STILL_CONTROL, (!enable) << 7, 0x80); 499 return reg_set(client, RJ54N1_STILL_CONTROL, (!enable) << 7, 0x80);
@@ -503,7 +503,7 @@ static int rj54n1_set_bus_param(struct soc_camera_device *icd,
503 unsigned long flags) 503 unsigned long flags)
504{ 504{
505 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 505 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
506 struct i2c_client *client = sd->priv; 506 struct i2c_client *client = v4l2_get_subdevdata(sd);
507 /* Figures 2.5-1 to 2.5-3 - default falling pixclk edge */ 507 /* Figures 2.5-1 to 2.5-3 - default falling pixclk edge */
508 508
509 if (flags & SOCAM_PCLK_SAMPLE_RISING) 509 if (flags & SOCAM_PCLK_SAMPLE_RISING)
@@ -560,7 +560,7 @@ static int rj54n1_sensor_scale(struct v4l2_subdev *sd, s32 *in_w, s32 *in_h,
560 560
561static int rj54n1_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) 561static int rj54n1_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
562{ 562{
563 struct i2c_client *client = sd->priv; 563 struct i2c_client *client = v4l2_get_subdevdata(sd);
564 struct rj54n1 *rj54n1 = to_rj54n1(client); 564 struct rj54n1 *rj54n1 = to_rj54n1(client);
565 struct v4l2_rect *rect = &a->c; 565 struct v4l2_rect *rect = &a->c;
566 int dummy = 0, output_w, output_h, 566 int dummy = 0, output_w, output_h,
@@ -595,7 +595,7 @@ static int rj54n1_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
595 595
596static int rj54n1_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) 596static int rj54n1_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
597{ 597{
598 struct i2c_client *client = sd->priv; 598 struct i2c_client *client = v4l2_get_subdevdata(sd);
599 struct rj54n1 *rj54n1 = to_rj54n1(client); 599 struct rj54n1 *rj54n1 = to_rj54n1(client);
600 600
601 a->c = rj54n1->rect; 601 a->c = rj54n1->rect;
@@ -621,7 +621,7 @@ static int rj54n1_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *a)
621static int rj54n1_g_fmt(struct v4l2_subdev *sd, 621static int rj54n1_g_fmt(struct v4l2_subdev *sd,
622 struct v4l2_mbus_framefmt *mf) 622 struct v4l2_mbus_framefmt *mf)
623{ 623{
624 struct i2c_client *client = sd->priv; 624 struct i2c_client *client = v4l2_get_subdevdata(sd);
625 struct rj54n1 *rj54n1 = to_rj54n1(client); 625 struct rj54n1 *rj54n1 = to_rj54n1(client);
626 626
627 mf->code = rj54n1->fmt->code; 627 mf->code = rj54n1->fmt->code;
@@ -641,7 +641,7 @@ static int rj54n1_g_fmt(struct v4l2_subdev *sd,
641static int rj54n1_sensor_scale(struct v4l2_subdev *sd, s32 *in_w, s32 *in_h, 641static int rj54n1_sensor_scale(struct v4l2_subdev *sd, s32 *in_w, s32 *in_h,
642 s32 *out_w, s32 *out_h) 642 s32 *out_w, s32 *out_h)
643{ 643{
644 struct i2c_client *client = sd->priv; 644 struct i2c_client *client = v4l2_get_subdevdata(sd);
645 struct rj54n1 *rj54n1 = to_rj54n1(client); 645 struct rj54n1 *rj54n1 = to_rj54n1(client);
646 unsigned int skip, resize, input_w = *in_w, input_h = *in_h, 646 unsigned int skip, resize, input_w = *in_w, input_h = *in_h,
647 output_w = *out_w, output_h = *out_h; 647 output_w = *out_w, output_h = *out_h;
@@ -983,7 +983,7 @@ static int rj54n1_reg_init(struct i2c_client *client)
983static int rj54n1_try_fmt(struct v4l2_subdev *sd, 983static int rj54n1_try_fmt(struct v4l2_subdev *sd,
984 struct v4l2_mbus_framefmt *mf) 984 struct v4l2_mbus_framefmt *mf)
985{ 985{
986 struct i2c_client *client = sd->priv; 986 struct i2c_client *client = v4l2_get_subdevdata(sd);
987 struct rj54n1 *rj54n1 = to_rj54n1(client); 987 struct rj54n1 *rj54n1 = to_rj54n1(client);
988 const struct rj54n1_datafmt *fmt; 988 const struct rj54n1_datafmt *fmt;
989 int align = mf->code == V4L2_MBUS_FMT_SBGGR10_1X10 || 989 int align = mf->code == V4L2_MBUS_FMT_SBGGR10_1X10 ||
@@ -1014,7 +1014,7 @@ static int rj54n1_try_fmt(struct v4l2_subdev *sd,
1014static int rj54n1_s_fmt(struct v4l2_subdev *sd, 1014static int rj54n1_s_fmt(struct v4l2_subdev *sd,
1015 struct v4l2_mbus_framefmt *mf) 1015 struct v4l2_mbus_framefmt *mf)
1016{ 1016{
1017 struct i2c_client *client = sd->priv; 1017 struct i2c_client *client = v4l2_get_subdevdata(sd);
1018 struct rj54n1 *rj54n1 = to_rj54n1(client); 1018 struct rj54n1 *rj54n1 = to_rj54n1(client);
1019 const struct rj54n1_datafmt *fmt; 1019 const struct rj54n1_datafmt *fmt;
1020 int output_w, output_h, max_w, max_h, 1020 int output_w, output_h, max_w, max_h,
@@ -1145,7 +1145,7 @@ static int rj54n1_s_fmt(struct v4l2_subdev *sd,
1145static int rj54n1_g_chip_ident(struct v4l2_subdev *sd, 1145static int rj54n1_g_chip_ident(struct v4l2_subdev *sd,
1146 struct v4l2_dbg_chip_ident *id) 1146 struct v4l2_dbg_chip_ident *id)
1147{ 1147{
1148 struct i2c_client *client = sd->priv; 1148 struct i2c_client *client = v4l2_get_subdevdata(sd);
1149 1149
1150 if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) 1150 if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
1151 return -EINVAL; 1151 return -EINVAL;
@@ -1163,7 +1163,7 @@ static int rj54n1_g_chip_ident(struct v4l2_subdev *sd,
1163static int rj54n1_g_register(struct v4l2_subdev *sd, 1163static int rj54n1_g_register(struct v4l2_subdev *sd,
1164 struct v4l2_dbg_register *reg) 1164 struct v4l2_dbg_register *reg)
1165{ 1165{
1166 struct i2c_client *client = sd->priv; 1166 struct i2c_client *client = v4l2_get_subdevdata(sd);
1167 1167
1168 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || 1168 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR ||
1169 reg->reg < 0x400 || reg->reg > 0x1fff) 1169 reg->reg < 0x400 || reg->reg > 0x1fff)
@@ -1185,7 +1185,7 @@ static int rj54n1_g_register(struct v4l2_subdev *sd,
1185static int rj54n1_s_register(struct v4l2_subdev *sd, 1185static int rj54n1_s_register(struct v4l2_subdev *sd,
1186 struct v4l2_dbg_register *reg) 1186 struct v4l2_dbg_register *reg)
1187{ 1187{
1188 struct i2c_client *client = sd->priv; 1188 struct i2c_client *client = v4l2_get_subdevdata(sd);
1189 1189
1190 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || 1190 if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR ||
1191 reg->reg < 0x400 || reg->reg > 0x1fff) 1191 reg->reg < 0x400 || reg->reg > 0x1fff)
@@ -1248,7 +1248,7 @@ static struct soc_camera_ops rj54n1_ops = {
1248 1248
1249static int rj54n1_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) 1249static int rj54n1_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
1250{ 1250{
1251 struct i2c_client *client = sd->priv; 1251 struct i2c_client *client = v4l2_get_subdevdata(sd);
1252 struct rj54n1 *rj54n1 = to_rj54n1(client); 1252 struct rj54n1 *rj54n1 = to_rj54n1(client);
1253 int data; 1253 int data;
1254 1254
@@ -1283,7 +1283,7 @@ static int rj54n1_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
1283static int rj54n1_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) 1283static int rj54n1_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
1284{ 1284{
1285 int data; 1285 int data;
1286 struct i2c_client *client = sd->priv; 1286 struct i2c_client *client = v4l2_get_subdevdata(sd);
1287 struct rj54n1 *rj54n1 = to_rj54n1(client); 1287 struct rj54n1 *rj54n1 = to_rj54n1(client);
1288 const struct v4l2_queryctrl *qctrl; 1288 const struct v4l2_queryctrl *qctrl;
1289 1289