aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/pci')
-rw-r--r--drivers/media/pci/bt8xx/bttv-driver.c10
-rw-r--r--drivers/media/pci/cx18/cx18-ioctl.c2
-rw-r--r--drivers/media/pci/cx25821/cx25821-video.c2
-rw-r--r--drivers/media/pci/cx25821/cx25821-video.h2
-rw-r--r--drivers/media/pci/ivtv/ivtv-ioctl.c2
-rw-r--r--drivers/media/pci/saa7134/saa7134-video.c32
-rw-r--r--drivers/media/pci/zoran/zoran_driver.c2
7 files changed, 26 insertions, 26 deletions
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index 31b282667463..16f5ca23698c 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -2986,7 +2986,7 @@ static int bttv_g_crop(struct file *file, void *f, struct v4l2_crop *crop)
2986 return 0; 2986 return 0;
2987} 2987}
2988 2988
2989static int bttv_s_crop(struct file *file, void *f, struct v4l2_crop *crop) 2989static int bttv_s_crop(struct file *file, void *f, const struct v4l2_crop *crop)
2990{ 2990{
2991 struct bttv_fh *fh = f; 2991 struct bttv_fh *fh = f;
2992 struct bttv *btv = fh->btv; 2992 struct bttv *btv = fh->btv;
@@ -3028,17 +3028,17 @@ static int bttv_s_crop(struct file *file, void *f, struct v4l2_crop *crop)
3028 } 3028 }
3029 3029
3030 /* Min. scaled size 48 x 32. */ 3030 /* Min. scaled size 48 x 32. */
3031 c.rect.left = clamp(crop->c.left, b_left, b_right - 48); 3031 c.rect.left = clamp_t(s32, crop->c.left, b_left, b_right - 48);
3032 c.rect.left = min(c.rect.left, (__s32) MAX_HDELAY); 3032 c.rect.left = min(c.rect.left, (__s32) MAX_HDELAY);
3033 3033
3034 c.rect.width = clamp(crop->c.width, 3034 c.rect.width = clamp_t(s32, crop->c.width,
3035 48, b_right - c.rect.left); 3035 48, b_right - c.rect.left);
3036 3036
3037 c.rect.top = clamp(crop->c.top, b_top, b_bottom - 32); 3037 c.rect.top = clamp_t(s32, crop->c.top, b_top, b_bottom - 32);
3038 /* Top and height must be a multiple of two. */ 3038 /* Top and height must be a multiple of two. */
3039 c.rect.top = (c.rect.top + 1) & ~1; 3039 c.rect.top = (c.rect.top + 1) & ~1;
3040 3040
3041 c.rect.height = clamp(crop->c.height, 3041 c.rect.height = clamp_t(s32, crop->c.height,
3042 32, b_bottom - c.rect.top); 3042 32, b_bottom - c.rect.top);
3043 c.rect.height = (c.rect.height + 1) & ~1; 3043 c.rect.height = (c.rect.height + 1) & ~1;
3044 3044
diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c
index ff315446d4ad..bb5073f72c42 100644
--- a/drivers/media/pci/cx18/cx18-ioctl.c
+++ b/drivers/media/pci/cx18/cx18-ioctl.c
@@ -527,7 +527,7 @@ static int cx18_cropcap(struct file *file, void *fh,
527 return 0; 527 return 0;
528} 528}
529 529
530static int cx18_s_crop(struct file *file, void *fh, struct v4l2_crop *crop) 530static int cx18_s_crop(struct file *file, void *fh, const struct v4l2_crop *crop)
531{ 531{
532 struct cx18_open_id *id = fh2id(fh); 532 struct cx18_open_id *id = fh2id(fh);
533 struct cx18 *cx = id->cx; 533 struct cx18 *cx = id->cx;
diff --git a/drivers/media/pci/cx25821/cx25821-video.c b/drivers/media/pci/cx25821/cx25821-video.c
index b38d4379cc36..0a80245165d0 100644
--- a/drivers/media/pci/cx25821/cx25821-video.c
+++ b/drivers/media/pci/cx25821/cx25821-video.c
@@ -1610,7 +1610,7 @@ int cx25821_vidioc_cropcap(struct file *file, void *priv,
1610 return 0; 1610 return 0;
1611} 1611}
1612 1612
1613int cx25821_vidioc_s_crop(struct file *file, void *priv, struct v4l2_crop *crop) 1613int cx25821_vidioc_s_crop(struct file *file, void *priv, const struct v4l2_crop *crop)
1614{ 1614{
1615 struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev; 1615 struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev;
1616 struct cx25821_fh *fh = priv; 1616 struct cx25821_fh *fh = priv;
diff --git a/drivers/media/pci/cx25821/cx25821-video.h b/drivers/media/pci/cx25821/cx25821-video.h
index 9652a5e35ba2..c265e35b37c3 100644
--- a/drivers/media/pci/cx25821/cx25821-video.h
+++ b/drivers/media/pci/cx25821/cx25821-video.h
@@ -177,7 +177,7 @@ extern int cx25821_set_control(struct cx25821_dev *dev,
177extern int cx25821_vidioc_cropcap(struct file *file, void *fh, 177extern int cx25821_vidioc_cropcap(struct file *file, void *fh,
178 struct v4l2_cropcap *cropcap); 178 struct v4l2_cropcap *cropcap);
179extern int cx25821_vidioc_s_crop(struct file *file, void *priv, 179extern int cx25821_vidioc_s_crop(struct file *file, void *priv,
180 struct v4l2_crop *crop); 180 const struct v4l2_crop *crop);
181extern int cx25821_vidioc_g_crop(struct file *file, void *priv, 181extern int cx25821_vidioc_g_crop(struct file *file, void *priv,
182 struct v4l2_crop *crop); 182 struct v4l2_crop *crop);
183 183
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c
index d5cbb6177754..ed6dcc7e61bc 100644
--- a/drivers/media/pci/ivtv/ivtv-ioctl.c
+++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
@@ -874,7 +874,7 @@ static int ivtv_cropcap(struct file *file, void *fh, struct v4l2_cropcap *cropca
874 return 0; 874 return 0;
875} 875}
876 876
877static int ivtv_s_crop(struct file *file, void *fh, struct v4l2_crop *crop) 877static int ivtv_s_crop(struct file *file, void *fh, const struct v4l2_crop *crop)
878{ 878{
879 struct ivtv_open_id *id = fh2id(fh); 879 struct ivtv_open_id *id = fh2id(fh);
880 struct ivtv *itv = id->itv; 880 struct ivtv *itv = id->itv;
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
index 135bfd8c28ad..22f8758d047f 100644
--- a/drivers/media/pci/saa7134/saa7134-video.c
+++ b/drivers/media/pci/saa7134/saa7134-video.c
@@ -1953,11 +1953,12 @@ static int saa7134_g_crop(struct file *file, void *f, struct v4l2_crop *crop)
1953 return 0; 1953 return 0;
1954} 1954}
1955 1955
1956static int saa7134_s_crop(struct file *file, void *f, struct v4l2_crop *crop) 1956static int saa7134_s_crop(struct file *file, void *f, const struct v4l2_crop *crop)
1957{ 1957{
1958 struct saa7134_fh *fh = f; 1958 struct saa7134_fh *fh = f;
1959 struct saa7134_dev *dev = fh->dev; 1959 struct saa7134_dev *dev = fh->dev;
1960 struct v4l2_rect *b = &dev->crop_bounds; 1960 struct v4l2_rect *b = &dev->crop_bounds;
1961 struct v4l2_rect *c = &dev->crop_current;
1961 1962
1962 if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && 1963 if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE &&
1963 crop->type != V4L2_BUF_TYPE_VIDEO_OVERLAY) 1964 crop->type != V4L2_BUF_TYPE_VIDEO_OVERLAY)
@@ -1972,21 +1973,20 @@ static int saa7134_s_crop(struct file *file, void *f, struct v4l2_crop *crop)
1972 if (res_locked(fh->dev, RESOURCE_VIDEO)) 1973 if (res_locked(fh->dev, RESOURCE_VIDEO))
1973 return -EBUSY; 1974 return -EBUSY;
1974 1975
1975 if (crop->c.top < b->top) 1976 *c = crop->c;
1976 crop->c.top = b->top; 1977 if (c->top < b->top)
1977 if (crop->c.top > b->top + b->height) 1978 c->top = b->top;
1978 crop->c.top = b->top + b->height; 1979 if (c->top > b->top + b->height)
1979 if (crop->c.height > b->top - crop->c.top + b->height) 1980 c->top = b->top + b->height;
1980 crop->c.height = b->top - crop->c.top + b->height; 1981 if (c->height > b->top - c->top + b->height)
1981 1982 c->height = b->top - c->top + b->height;
1982 if (crop->c.left < b->left) 1983
1983 crop->c.left = b->left; 1984 if (c->left < b->left)
1984 if (crop->c.left > b->left + b->width) 1985 c->left = b->left;
1985 crop->c.left = b->left + b->width; 1986 if (c->left > b->left + b->width)
1986 if (crop->c.width > b->left - crop->c.left + b->width) 1987 c->left = b->left + b->width;
1987 crop->c.width = b->left - crop->c.left + b->width; 1988 if (c->width > b->left - c->left + b->width)
1988 1989 c->width = b->left - c->left + b->width;
1989 dev->crop_current = crop->c;
1990 return 0; 1990 return 0;
1991} 1991}
1992 1992
diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c
index 9ecd7d711f27..53f12c7466b0 100644
--- a/drivers/media/pci/zoran/zoran_driver.c
+++ b/drivers/media/pci/zoran/zoran_driver.c
@@ -2598,7 +2598,7 @@ gcrop_unlock_and_return:
2598 return res; 2598 return res;
2599} 2599}
2600 2600
2601static int zoran_s_crop(struct file *file, void *__fh, struct v4l2_crop *crop) 2601static int zoran_s_crop(struct file *file, void *__fh, const struct v4l2_crop *crop)
2602{ 2602{
2603 struct zoran_fh *fh = __fh; 2603 struct zoran_fh *fh = __fh;
2604 struct zoran *zr = fh->zr; 2604 struct zoran *zr = fh->zr;