diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-11-25 07:39:50 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 14:53:41 -0500 |
commit | 505b6d0b774fa4475fedbd3cebf95199c17a0086 (patch) | |
tree | ea8fe176eba79808734e5d23241f67d0dbd1cc91 /drivers/media/video/em28xx/em28xx-video.c | |
parent | d4d889e329bd0837598b3ef611806421754e9b83 (diff) |
V4L/DVB (9752): Remove duplicated fields on em28xx_board and em28xx structs
Several fields are duplicated on both structs. Let's just copy em28xx_board instead.
A later cleanup could just copy the fields that are changed, in order to keep em28xx_board
const.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 5cf32aed8c2e..845253c5d2a1 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -517,7 +517,7 @@ static int em28xx_config(struct em28xx *dev) | |||
517 | int retval; | 517 | int retval; |
518 | 518 | ||
519 | /* Sets I2C speed to 100 KHz */ | 519 | /* Sets I2C speed to 100 KHz */ |
520 | if (!dev->is_em2800) { | 520 | if (!dev->board.is_em2800) { |
521 | retval = em28xx_write_regs_req(dev, 0x00, 0x06, "\x40", 1); | 521 | retval = em28xx_write_regs_req(dev, 0x00, 0x06, "\x40", 1); |
522 | if (retval < 0) { | 522 | if (retval < 0) { |
523 | em28xx_errdev("%s: em28xx_write_regs_req failed! retval [%d]\n", | 523 | em28xx_errdev("%s: em28xx_write_regs_req failed! retval [%d]\n", |
@@ -573,7 +573,7 @@ static void video_mux(struct em28xx *dev, int index) | |||
573 | 573 | ||
574 | em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route); | 574 | em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route); |
575 | 575 | ||
576 | if (dev->has_msp34xx) { | 576 | if (dev->board.has_msp34xx) { |
577 | if (dev->i2s_speed) { | 577 | if (dev->i2s_speed) { |
578 | em28xx_i2c_call_clients(dev, VIDIOC_INT_I2S_CLOCK_FREQ, | 578 | em28xx_i2c_call_clients(dev, VIDIOC_INT_I2S_CLOCK_FREQ, |
579 | &dev->i2s_speed); | 579 | &dev->i2s_speed); |
@@ -747,7 +747,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, | |||
747 | 747 | ||
748 | mutex_lock(&dev->lock); | 748 | mutex_lock(&dev->lock); |
749 | 749 | ||
750 | if (dev->is_em2800) { | 750 | if (dev->board.is_em2800) { |
751 | /* the em2800 can only scale down to 50% */ | 751 | /* the em2800 can only scale down to 50% */ |
752 | if (height % (maxh / 2)) | 752 | if (height % (maxh / 2)) |
753 | height = maxh; | 753 | height = maxh; |
@@ -998,7 +998,7 @@ static int vidioc_queryctrl(struct file *file, void *priv, | |||
998 | 998 | ||
999 | qc->id = id; | 999 | qc->id = id; |
1000 | 1000 | ||
1001 | if (!dev->has_msp34xx) { | 1001 | if (!dev->board.has_msp34xx) { |
1002 | for (i = 0; i < ARRAY_SIZE(em28xx_qctrl); i++) { | 1002 | for (i = 0; i < ARRAY_SIZE(em28xx_qctrl); i++) { |
1003 | if (qc->id && qc->id == em28xx_qctrl[i].id) { | 1003 | if (qc->id && qc->id == em28xx_qctrl[i].id) { |
1004 | memcpy(qc, &(em28xx_qctrl[i]), sizeof(*qc)); | 1004 | memcpy(qc, &(em28xx_qctrl[i]), sizeof(*qc)); |
@@ -1028,7 +1028,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv, | |||
1028 | return rc; | 1028 | return rc; |
1029 | mutex_lock(&dev->lock); | 1029 | mutex_lock(&dev->lock); |
1030 | 1030 | ||
1031 | if (!dev->has_msp34xx) | 1031 | if (!dev->board.has_msp34xx) |
1032 | rc = em28xx_get_ctrl(dev, ctrl); | 1032 | rc = em28xx_get_ctrl(dev, ctrl); |
1033 | else | 1033 | else |
1034 | rc = -EINVAL; | 1034 | rc = -EINVAL; |
@@ -1056,7 +1056,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, | |||
1056 | 1056 | ||
1057 | mutex_lock(&dev->lock); | 1057 | mutex_lock(&dev->lock); |
1058 | 1058 | ||
1059 | if (dev->has_msp34xx) | 1059 | if (dev->board.has_msp34xx) |
1060 | em28xx_i2c_call_clients(dev, VIDIOC_S_CTRL, ctrl); | 1060 | em28xx_i2c_call_clients(dev, VIDIOC_S_CTRL, ctrl); |
1061 | else { | 1061 | else { |
1062 | rc = 1; | 1062 | rc = 1; |
@@ -2035,7 +2035,7 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
2035 | dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len; | 2035 | dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len; |
2036 | dev->em28xx_write_regs_req = em28xx_write_regs_req; | 2036 | dev->em28xx_write_regs_req = em28xx_write_regs_req; |
2037 | dev->em28xx_read_reg_req = em28xx_read_reg_req; | 2037 | dev->em28xx_read_reg_req = em28xx_read_reg_req; |
2038 | dev->is_em2800 = em28xx_boards[dev->model].is_em2800; | 2038 | dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800; |
2039 | 2039 | ||
2040 | em28xx_pre_card_setup(dev); | 2040 | em28xx_pre_card_setup(dev); |
2041 | 2041 | ||
@@ -2092,7 +2092,7 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
2092 | INIT_LIST_HEAD(&dev->vidq.queued); | 2092 | INIT_LIST_HEAD(&dev->vidq.queued); |
2093 | 2093 | ||
2094 | 2094 | ||
2095 | if (dev->has_msp34xx) { | 2095 | if (dev->board.has_msp34xx) { |
2096 | /* Send a reset to other chips via gpio */ | 2096 | /* Send a reset to other chips via gpio */ |
2097 | errCode = em28xx_write_regs_req(dev, 0x00, 0x08, "\xf7", 1); | 2097 | errCode = em28xx_write_regs_req(dev, 0x00, 0x08, "\xf7", 1); |
2098 | if (errCode < 0) { | 2098 | if (errCode < 0) { |
@@ -2150,7 +2150,7 @@ static void request_module_async(struct work_struct *work) | |||
2150 | else if (dev->has_alsa_audio) | 2150 | else if (dev->has_alsa_audio) |
2151 | request_module("em28xx-alsa"); | 2151 | request_module("em28xx-alsa"); |
2152 | 2152 | ||
2153 | if (dev->has_dvb) | 2153 | if (dev->board.has_dvb) |
2154 | request_module("em28xx-dvb"); | 2154 | request_module("em28xx-dvb"); |
2155 | } | 2155 | } |
2156 | 2156 | ||