summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/mars.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-05-09 16:19:00 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-14 14:42:34 +0200
commita8a478601ac1d8877e23cb832fe4b44042ce6f20 (patch)
treec2a0074e12c85ba852f340bbf83ec5fbd0ec348c /drivers/media/video/gspca/mars.c
parent[media] gspca_mars: Convert to the control framework (diff)
downloadlinux-a8a478601ac1d8877e23cb832fe4b44042ce6f20.tar.xz
linux-a8a478601ac1d8877e23cb832fe4b44042ce6f20.zip
[media] gscpa: Move ctrl_handler to gspca_dev
We intend to eventually port all sub-drivers to the control-framework. At which point it will make more sense to have the ctrl_handler in gspca_dev then to have it in the subdrivers. Lets move it there now, to avoid a lot of work to move it later. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/mars.c')
-rw-r--r--drivers/media/video/gspca/mars.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/media/video/gspca/mars.c b/drivers/media/video/gspca/mars.c
index 2950347b8265..ec7b21ee79fb 100644
--- a/drivers/media/video/gspca/mars.c
+++ b/drivers/media/video/gspca/mars.c
@@ -34,7 +34,6 @@ MODULE_LICENSE("GPL");
struct sd {
struct gspca_dev gspca_dev; /* !! must be the first item */
- struct v4l2_ctrl_handler ctrl_handler;
struct v4l2_ctrl *brightness;
struct v4l2_ctrl *saturation;
struct v4l2_ctrl *sharpness;
@@ -161,8 +160,9 @@ static void setilluminators(struct gspca_dev *gspca_dev, bool top, bool bottom)
static int mars_s_ctrl(struct v4l2_ctrl *ctrl)
{
- struct sd *sd = container_of(ctrl->handler, struct sd, ctrl_handler);
- struct gspca_dev *gspca_dev = &sd->gspca_dev;
+ struct gspca_dev *gspca_dev =
+ container_of(ctrl->handler, struct gspca_dev, ctrl_handler);
+ struct sd *sd = (struct sd *)gspca_dev;
gspca_dev->usb_err = 0;
@@ -179,20 +179,20 @@ static int mars_s_ctrl(struct v4l2_ctrl *ctrl)
switch (ctrl->id) {
case V4L2_CID_BRIGHTNESS:
- setbrightness(&sd->gspca_dev, ctrl->val);
+ setbrightness(gspca_dev, ctrl->val);
break;
case V4L2_CID_SATURATION:
- setcolors(&sd->gspca_dev, ctrl->val);
+ setcolors(gspca_dev, ctrl->val);
break;
case V4L2_CID_GAMMA:
- setgamma(&sd->gspca_dev, ctrl->val);
+ setgamma(gspca_dev, ctrl->val);
break;
case V4L2_CID_ILLUMINATORS_1:
- setilluminators(&sd->gspca_dev, sd->illum_top->val,
- sd->illum_bottom->val);
+ setilluminators(gspca_dev, sd->illum_top->val,
+ sd->illum_bottom->val);
break;
case V4L2_CID_SHARPNESS:
- setsharpness(&sd->gspca_dev, ctrl->val);
+ setsharpness(gspca_dev, ctrl->val);
break;
case V4L2_CID_JPEG_COMPRESSION_QUALITY:
jpeg_set_qual(sd->jpeg_hdr, ctrl->val);
@@ -211,7 +211,7 @@ static const struct v4l2_ctrl_ops mars_ctrl_ops = {
static int sd_init_controls(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
- struct v4l2_ctrl_handler *hdl = &sd->ctrl_handler;
+ struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler;
gspca_dev->vdev.ctrl_handler = hdl;
v4l2_ctrl_handler_init(hdl, 7);