summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/zc3xx.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-05-09 11:19:00 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-14 09:42:34 -0300
commita8a478601ac1d8877e23cb832fe4b44042ce6f20 (patch)
treec2a0074e12c85ba852f340bbf83ec5fbd0ec348c /drivers/media/video/gspca/zc3xx.c
parent98684298f9ed89554cdaa4afe2554fca8276d1e9 (diff)
[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/zc3xx.c')
-rw-r--r--drivers/media/video/gspca/zc3xx.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index a8839fb3c1d..0d504a7c512 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -39,7 +39,6 @@ static int force_sensor = -1;
struct sd {
struct gspca_dev gspca_dev; /* !! must be the first item */
- struct v4l2_ctrl_handler ctrl_handler;
struct { /* gamma/brightness/contrast control cluster */
struct v4l2_ctrl *gamma;
struct v4l2_ctrl *brightness;
@@ -6328,8 +6327,9 @@ static int sd_config(struct gspca_dev *gspca_dev,
static int zcxx_g_volatile_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;
switch (ctrl->id) {
case V4L2_CID_AUTOGAIN:
@@ -6343,8 +6343,9 @@ static int zcxx_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
static int zcxx_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;
int i, qual;
gspca_dev->usb_err = 0;
@@ -6404,7 +6405,7 @@ static const struct v4l2_ctrl_ops zcxx_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;
static const u8 gamma[SENSOR_MAX] = {
[SENSOR_ADCM2700] = 4,
[SENSOR_CS2102] = 4,