diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-07-30 16:24:54 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-20 23:04:51 -0400 |
commit | c4ce6d14b92aa1772c9d84d068d1b45114fe73cc (patch) | |
tree | b2c492597824d43fad603cc686c3d16b3f766b0c /drivers/media/video/mt9m001.c | |
parent | 401ad27867781c327855025d4becd5bc30fe7e42 (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/mt9m001.c')
-rw-r--r-- | drivers/media/video/mt9m001.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/media/video/mt9m001.c b/drivers/media/video/mt9m001.c index 79f096ddcf5d..fcb4cd941853 100644 --- a/drivers/media/video/mt9m001.c +++ b/drivers/media/video/mt9m001.c | |||
@@ -157,7 +157,7 @@ static int mt9m001_init(struct i2c_client *client) | |||
157 | 157 | ||
158 | static int mt9m001_s_stream(struct v4l2_subdev *sd, int enable) | 158 | static int mt9m001_s_stream(struct v4l2_subdev *sd, int enable) |
159 | { | 159 | { |
160 | struct i2c_client *client = sd->priv; | 160 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
161 | 161 | ||
162 | /* Switch to master "normal" mode or stop sensor readout */ | 162 | /* Switch to master "normal" mode or stop sensor readout */ |
163 | if (reg_write(client, MT9M001_OUTPUT_CONTROL, enable ? 2 : 0) < 0) | 163 | if (reg_write(client, MT9M001_OUTPUT_CONTROL, enable ? 2 : 0) < 0) |
@@ -206,7 +206,7 @@ static unsigned long mt9m001_query_bus_param(struct soc_camera_device *icd) | |||
206 | 206 | ||
207 | static int mt9m001_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) | 207 | static int mt9m001_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) |
208 | { | 208 | { |
209 | struct i2c_client *client = sd->priv; | 209 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
210 | struct mt9m001 *mt9m001 = to_mt9m001(client); | 210 | struct mt9m001 *mt9m001 = to_mt9m001(client); |
211 | struct v4l2_rect rect = a->c; | 211 | struct v4l2_rect rect = a->c; |
212 | struct soc_camera_device *icd = client->dev.platform_data; | 212 | struct soc_camera_device *icd = client->dev.platform_data; |
@@ -271,7 +271,7 @@ static int mt9m001_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) | |||
271 | 271 | ||
272 | static int mt9m001_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) | 272 | static int mt9m001_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) |
273 | { | 273 | { |
274 | struct i2c_client *client = sd->priv; | 274 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
275 | struct mt9m001 *mt9m001 = to_mt9m001(client); | 275 | struct mt9m001 *mt9m001 = to_mt9m001(client); |
276 | 276 | ||
277 | a->c = mt9m001->rect; | 277 | a->c = mt9m001->rect; |
@@ -297,7 +297,7 @@ static int mt9m001_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *a) | |||
297 | static int mt9m001_g_fmt(struct v4l2_subdev *sd, | 297 | static int mt9m001_g_fmt(struct v4l2_subdev *sd, |
298 | struct v4l2_mbus_framefmt *mf) | 298 | struct v4l2_mbus_framefmt *mf) |
299 | { | 299 | { |
300 | struct i2c_client *client = sd->priv; | 300 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
301 | struct mt9m001 *mt9m001 = to_mt9m001(client); | 301 | struct mt9m001 *mt9m001 = to_mt9m001(client); |
302 | 302 | ||
303 | mf->width = mt9m001->rect.width; | 303 | mf->width = mt9m001->rect.width; |
@@ -312,7 +312,7 @@ static int mt9m001_g_fmt(struct v4l2_subdev *sd, | |||
312 | static int mt9m001_s_fmt(struct v4l2_subdev *sd, | 312 | static int mt9m001_s_fmt(struct v4l2_subdev *sd, |
313 | struct v4l2_mbus_framefmt *mf) | 313 | struct v4l2_mbus_framefmt *mf) |
314 | { | 314 | { |
315 | struct i2c_client *client = sd->priv; | 315 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
316 | struct mt9m001 *mt9m001 = to_mt9m001(client); | 316 | struct mt9m001 *mt9m001 = to_mt9m001(client); |
317 | struct v4l2_crop a = { | 317 | struct v4l2_crop a = { |
318 | .c = { | 318 | .c = { |
@@ -340,7 +340,7 @@ static int mt9m001_s_fmt(struct v4l2_subdev *sd, | |||
340 | static int mt9m001_try_fmt(struct v4l2_subdev *sd, | 340 | static int mt9m001_try_fmt(struct v4l2_subdev *sd, |
341 | struct v4l2_mbus_framefmt *mf) | 341 | struct v4l2_mbus_framefmt *mf) |
342 | { | 342 | { |
343 | struct i2c_client *client = sd->priv; | 343 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
344 | struct mt9m001 *mt9m001 = to_mt9m001(client); | 344 | struct mt9m001 *mt9m001 = to_mt9m001(client); |
345 | const struct mt9m001_datafmt *fmt; | 345 | const struct mt9m001_datafmt *fmt; |
346 | 346 | ||
@@ -367,7 +367,7 @@ static int mt9m001_try_fmt(struct v4l2_subdev *sd, | |||
367 | static int mt9m001_g_chip_ident(struct v4l2_subdev *sd, | 367 | static int mt9m001_g_chip_ident(struct v4l2_subdev *sd, |
368 | struct v4l2_dbg_chip_ident *id) | 368 | struct v4l2_dbg_chip_ident *id) |
369 | { | 369 | { |
370 | struct i2c_client *client = sd->priv; | 370 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
371 | struct mt9m001 *mt9m001 = to_mt9m001(client); | 371 | struct mt9m001 *mt9m001 = to_mt9m001(client); |
372 | 372 | ||
373 | if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) | 373 | if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) |
@@ -386,7 +386,7 @@ static int mt9m001_g_chip_ident(struct v4l2_subdev *sd, | |||
386 | static int mt9m001_g_register(struct v4l2_subdev *sd, | 386 | static int mt9m001_g_register(struct v4l2_subdev *sd, |
387 | struct v4l2_dbg_register *reg) | 387 | struct v4l2_dbg_register *reg) |
388 | { | 388 | { |
389 | struct i2c_client *client = sd->priv; | 389 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
390 | 390 | ||
391 | if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) | 391 | if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) |
392 | return -EINVAL; | 392 | return -EINVAL; |
@@ -406,7 +406,7 @@ static int mt9m001_g_register(struct v4l2_subdev *sd, | |||
406 | static int mt9m001_s_register(struct v4l2_subdev *sd, | 406 | static int mt9m001_s_register(struct v4l2_subdev *sd, |
407 | struct v4l2_dbg_register *reg) | 407 | struct v4l2_dbg_register *reg) |
408 | { | 408 | { |
409 | struct i2c_client *client = sd->priv; | 409 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
410 | 410 | ||
411 | if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) | 411 | if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff) |
412 | return -EINVAL; | 412 | return -EINVAL; |
@@ -468,7 +468,7 @@ static struct soc_camera_ops mt9m001_ops = { | |||
468 | 468 | ||
469 | static int mt9m001_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) | 469 | static int mt9m001_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) |
470 | { | 470 | { |
471 | struct i2c_client *client = sd->priv; | 471 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
472 | struct mt9m001 *mt9m001 = to_mt9m001(client); | 472 | struct mt9m001 *mt9m001 = to_mt9m001(client); |
473 | int data; | 473 | int data; |
474 | 474 | ||
@@ -494,7 +494,7 @@ static int mt9m001_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) | |||
494 | 494 | ||
495 | static int mt9m001_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) | 495 | static int mt9m001_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) |
496 | { | 496 | { |
497 | struct i2c_client *client = sd->priv; | 497 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
498 | struct mt9m001 *mt9m001 = to_mt9m001(client); | 498 | struct mt9m001 *mt9m001 = to_mt9m001(client); |
499 | struct soc_camera_device *icd = client->dev.platform_data; | 499 | struct soc_camera_device *icd = client->dev.platform_data; |
500 | const struct v4l2_queryctrl *qctrl; | 500 | const struct v4l2_queryctrl *qctrl; |
@@ -683,7 +683,7 @@ static void mt9m001_video_remove(struct soc_camera_device *icd) | |||
683 | 683 | ||
684 | static int mt9m001_g_skip_top_lines(struct v4l2_subdev *sd, u32 *lines) | 684 | static int mt9m001_g_skip_top_lines(struct v4l2_subdev *sd, u32 *lines) |
685 | { | 685 | { |
686 | struct i2c_client *client = sd->priv; | 686 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
687 | struct mt9m001 *mt9m001 = to_mt9m001(client); | 687 | struct mt9m001 *mt9m001 = to_mt9m001(client); |
688 | 688 | ||
689 | *lines = mt9m001->y_skip_top; | 689 | *lines = mt9m001->y_skip_top; |
@@ -704,7 +704,7 @@ static struct v4l2_subdev_core_ops mt9m001_subdev_core_ops = { | |||
704 | static int mt9m001_enum_fmt(struct v4l2_subdev *sd, unsigned int index, | 704 | static int mt9m001_enum_fmt(struct v4l2_subdev *sd, unsigned int index, |
705 | enum v4l2_mbus_pixelcode *code) | 705 | enum v4l2_mbus_pixelcode *code) |
706 | { | 706 | { |
707 | struct i2c_client *client = sd->priv; | 707 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
708 | struct mt9m001 *mt9m001 = to_mt9m001(client); | 708 | struct mt9m001 *mt9m001 = to_mt9m001(client); |
709 | 709 | ||
710 | if (index >= mt9m001->num_fmts) | 710 | if (index >= mt9m001->num_fmts) |