Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] soc-camera: remove redundant parameter from .set_bus_param()

The "pixfmt" parameter of the struct soc_camera_host_ops::set_bus_param()
method is redundant, because at the time, when this method is called,
pixfmt is guaranteed to be equal to icd->current_fmt->host_fmt->fourcc.
Remove this parameter and update all drivers accordingly.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Guennadi Liakhovetski and committed by
Mauro Carvalho Chehab
8843d119 31e582e9

+13 -19
+1 -1
drivers/media/video/atmel-isi.c
··· 803 803 return 0; 804 804 } 805 805 806 - static int isi_camera_set_bus_param(struct soc_camera_device *icd, u32 pixfmt) 806 + static int isi_camera_set_bus_param(struct soc_camera_device *icd) 807 807 { 808 808 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 809 809 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
+1 -1
drivers/media/video/mx1_camera.c
··· 487 487 return v4l2_subdev_call(sd, video, s_crop, a); 488 488 } 489 489 490 - static int mx1_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt) 490 + static int mx1_camera_set_bus_param(struct soc_camera_device *icd) 491 491 { 492 492 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 493 493 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
+1 -2
drivers/media/video/mx2_camera.c
··· 766 766 pcdev->base_emma + PRP_INTR_CNTL); 767 767 } 768 768 769 - static int mx2_camera_set_bus_param(struct soc_camera_device *icd, 770 - __u32 pixfmt) 769 + static int mx2_camera_set_bus_param(struct soc_camera_device *icd) 771 770 { 772 771 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 773 772 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
+2 -1
drivers/media/video/mx3_camera.c
··· 982 982 return 0; 983 983 } 984 984 985 - static int mx3_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt) 985 + static int mx3_camera_set_bus_param(struct soc_camera_device *icd) 986 986 { 987 987 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 988 988 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 989 989 struct mx3_camera_dev *mx3_cam = ici->priv; 990 990 struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,}; 991 + u32 pixfmt = icd->current_fmt->host_fmt->fourcc; 991 992 unsigned long bus_flags, common_flags; 992 993 u32 dw, sens_conf; 993 994 const struct soc_mbus_pixelfmt *fmt;
+2 -2
drivers/media/video/omap1_camera.c
··· 1436 1436 return 0; 1437 1437 } 1438 1438 1439 - static int omap1_cam_set_bus_param(struct soc_camera_device *icd, 1440 - __u32 pixfmt) 1439 + static int omap1_cam_set_bus_param(struct soc_camera_device *icd) 1441 1440 { 1442 1441 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 1443 1442 struct device *dev = icd->parent; 1444 1443 struct soc_camera_host *ici = to_soc_camera_host(dev); 1445 1444 struct omap1_cam_dev *pcdev = ici->priv; 1445 + u32 pixfmt = icd->current_fmt->host_fmt->fourcc; 1446 1446 const struct soc_camera_format_xlate *xlate; 1447 1447 const struct soc_mbus_pixelfmt *fmt; 1448 1448 struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,};
+2 -1
drivers/media/video/pxa_camera.c
··· 1133 1133 __raw_writel(cicr0, pcdev->base + CICR0); 1134 1134 } 1135 1135 1136 - static int pxa_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt) 1136 + static int pxa_camera_set_bus_param(struct soc_camera_device *icd) 1137 1137 { 1138 1138 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 1139 1139 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 1140 1140 struct pxa_camera_dev *pcdev = ici->priv; 1141 1141 struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,}; 1142 + u32 pixfmt = icd->current_fmt->host_fmt->fourcc; 1142 1143 unsigned long bus_flags, common_flags; 1143 1144 int ret; 1144 1145 struct pxa_cam *cam = icd->host_priv;
+2 -9
drivers/media/video/sh_mobile_ceu_camera.c
··· 786 786 V4L2_MBUS_DATA_ACTIVE_HIGH) 787 787 788 788 /* Capture is not running, no interrupts, no locking needed */ 789 - static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd, 790 - __u32 pixfmt) 789 + static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd) 791 790 { 792 791 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 793 792 struct sh_mobile_ceu_dev *pcdev = ici->priv; ··· 923 924 924 925 ceu_write(pcdev, CDOCR, value); 925 926 ceu_write(pcdev, CFWCR, 0); /* keep "datafetch firewall" disabled */ 926 - 927 - dev_dbg(icd->parent, "S_FMT successful for %c%c%c%c %ux%u\n", 928 - pixfmt & 0xff, (pixfmt >> 8) & 0xff, 929 - (pixfmt >> 16) & 0xff, (pixfmt >> 24) & 0xff, 930 - icd->user_width, icd->user_height); 931 927 932 928 capture_restore(pcdev, capsr); 933 929 ··· 1960 1966 if (!ret) { 1961 1967 icd->user_width = out_width & ~3; 1962 1968 icd->user_height = out_height & ~3; 1963 - ret = sh_mobile_ceu_set_bus_param(icd, 1964 - icd->current_fmt->host_fmt->fourcc); 1969 + ret = sh_mobile_ceu_set_bus_param(icd); 1965 1970 } 1966 1971 } 1967 1972
+1 -1
drivers/media/video/soc_camera.c
··· 487 487 icd->user_width, icd->user_height); 488 488 489 489 /* set physical bus parameters */ 490 - return ici->ops->set_bus_param(icd, pix->pixelformat); 490 + return ici->ops->set_bus_param(icd); 491 491 } 492 492 493 493 static int soc_camera_open(struct file *file)
+1 -1
include/media/soc_camera.h
··· 94 94 struct soc_camera_device *); 95 95 int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *); 96 96 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *); 97 - int (*set_bus_param)(struct soc_camera_device *, __u32); 97 + int (*set_bus_param)(struct soc_camera_device *); 98 98 int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *); 99 99 int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *); 100 100 int (*enum_fsizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *);