Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330870
b: refs/heads/master
c: 47de502
h: refs/heads/master
v: v3
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed Aug 15, 2012
1 parent e55fb2f commit e0f993f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9f717e9022d60fb653bad47a320bf0499c6fb549
refs/heads/master: 47de502b04612824e9293ed0474882b461be49d9
21 changes: 10 additions & 11 deletions trunk/drivers/media/i2c/soc_camera/ov772x.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,10 +525,9 @@ static const struct ov772x_win_size ov772x_win_sizes[] = {
* general function
*/

static struct ov772x_priv *to_ov772x(const struct i2c_client *client)
static struct ov772x_priv *to_ov772x(struct v4l2_subdev *sd)
{
return container_of(i2c_get_clientdata(client), struct ov772x_priv,
subdev);
return container_of(sd, struct ov772x_priv, subdev);
}

static int ov772x_write_array(struct i2c_client *client,
Expand Down Expand Up @@ -574,7 +573,7 @@ static int ov772x_reset(struct i2c_client *client)
static int ov772x_s_stream(struct v4l2_subdev *sd, int enable)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct ov772x_priv *priv = container_of(sd, struct ov772x_priv, subdev);
struct ov772x_priv *priv = to_ov772x(sd);

if (!enable) {
ov772x_mask_set(client, COM2, SOFT_SLEEP_MODE, SOFT_SLEEP_MODE);
Expand Down Expand Up @@ -638,7 +637,7 @@ static int ov772x_s_ctrl(struct v4l2_ctrl *ctrl)
static int ov772x_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *id)
{
struct ov772x_priv *priv = container_of(sd, struct ov772x_priv, subdev);
struct ov772x_priv *priv = to_ov772x(sd);

id->ident = priv->model;
id->revision = 0;
Expand Down Expand Up @@ -880,7 +879,7 @@ static int ov772x_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *a)
static int ov772x_g_fmt(struct v4l2_subdev *sd,
struct v4l2_mbus_framefmt *mf)
{
struct ov772x_priv *priv = container_of(sd, struct ov772x_priv, subdev);
struct ov772x_priv *priv = to_ov772x(sd);

mf->width = priv->win->width;
mf->height = priv->win->height;
Expand All @@ -893,7 +892,7 @@ static int ov772x_g_fmt(struct v4l2_subdev *sd,

static int ov772x_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf)
{
struct ov772x_priv *priv = container_of(sd, struct ov772x_priv, subdev);
struct ov772x_priv *priv = to_ov772x(sd);
const struct ov772x_color_format *cfmt;
const struct ov772x_win_size *win;
int ret;
Expand Down Expand Up @@ -933,9 +932,9 @@ static int ov772x_try_fmt(struct v4l2_subdev *sd,
return 0;
}

static int ov772x_video_probe(struct i2c_client *client)
static int ov772x_video_probe(struct ov772x_priv *priv)
{
struct ov772x_priv *priv = to_ov772x(client);
struct i2c_client *client = v4l2_get_subdevdata(&priv->subdev);
u8 pid, ver;
const char *devname;
int ret;
Expand Down Expand Up @@ -1078,7 +1077,7 @@ static int ov772x_probe(struct i2c_client *client,
goto done;
}

ret = ov772x_video_probe(client);
ret = ov772x_video_probe(priv);
if (ret < 0)
goto done;

Expand All @@ -1095,7 +1094,7 @@ static int ov772x_probe(struct i2c_client *client,

static int ov772x_remove(struct i2c_client *client)
{
struct ov772x_priv *priv = to_ov772x(client);
struct ov772x_priv *priv = to_ov772x(i2c_get_clientdata(client));

v4l2_device_unregister_subdev(&priv->subdev);
v4l2_ctrl_handler_free(&priv->hdl);
Expand Down

0 comments on commit e0f993f

Please sign in to comment.