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

Configure Feed

Select the types of activity you want to include in your feed.

media: v4l2-ioctl: Push NULL fh argument down to ioctl wrappers

As ioctl handlers do not expect a priv argument anymore, start pushing
the NULL pointer down from __video_do_ioctl() to the ioctl wrappers.
This paves the way to dropping the void *priv argument to ioctl handlers
themselves.

Changes to ioctl wrappers have been generated with the following
coccinelle semantic patch:

@ioctl@
identifier v4l2_ioctls;
identifier ioctl;
identifier fn;
identifier debug;
expression flags;
@@
struct v4l2_ioctl_info v4l2_ioctls[] = {
...,
IOCTL_INFO(ioctl, fn, debug, flags),
...,
};

@depends on ioctl@
identifier ioctl.fn;
identifier ops;
identifier file;
identifier fh;
identifier arg;
identifier handler;
expression list args;
@@
-int fn(const struct v4l2_ioctl_ops *ops, struct file *file, void *fh, void *arg)
+int fn(const struct v4l2_ioctl_ops *ops, struct file *file, void *arg)
{
<...
- ops->handler(file, fh, args)
+ ops->handler(file, NULL, args)
...>
}

Manual changes have been added to handle the calls to
v4l_[gs]_selection(), drop the fh argument in the v4l2_ioctl_info
structure definition and in the DEFINE_V4L_STUB_FUNC() macro, and stop
passing NULL to the wrappers in __video_do_ioctl()

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Laurent Pinchart and committed by
Hans Verkuil
35c0ae6d 0f1a7fac

+201 -201
+201 -201
drivers/media/v4l2-core/v4l2-ioctl.c
··· 1089 1089 } 1090 1090 } 1091 1091 1092 - static int v4l_querycap(const struct v4l2_ioctl_ops *ops, 1093 - struct file *file, void *fh, void *arg) 1092 + static int v4l_querycap(const struct v4l2_ioctl_ops *ops, struct file *file, 1093 + void *arg) 1094 1094 { 1095 1095 struct v4l2_capability *cap = (struct v4l2_capability *)arg; 1096 1096 struct video_device *vfd = video_devdata(file); ··· 1103 1103 media_set_bus_info(cap->bus_info, sizeof(cap->bus_info), 1104 1104 vfd->dev_parent); 1105 1105 1106 - ret = ops->vidioc_querycap(file, fh, cap); 1106 + ret = ops->vidioc_querycap(file, NULL, cap); 1107 1107 1108 1108 /* 1109 1109 * Drivers must not change device_caps, so check for this and ··· 1123 1123 return ret; 1124 1124 } 1125 1125 1126 - static int v4l_g_input(const struct v4l2_ioctl_ops *ops, 1127 - struct file *file, void *fh, void *arg) 1126 + static int v4l_g_input(const struct v4l2_ioctl_ops *ops, struct file *file, 1127 + void *arg) 1128 1128 { 1129 1129 struct video_device *vfd = video_devdata(file); 1130 1130 ··· 1133 1133 return 0; 1134 1134 } 1135 1135 1136 - return ops->vidioc_g_input(file, fh, arg); 1136 + return ops->vidioc_g_input(file, NULL, arg); 1137 1137 } 1138 1138 1139 - static int v4l_g_output(const struct v4l2_ioctl_ops *ops, 1140 - struct file *file, void *fh, void *arg) 1139 + static int v4l_g_output(const struct v4l2_ioctl_ops *ops, struct file *file, 1140 + void *arg) 1141 1141 { 1142 1142 struct video_device *vfd = video_devdata(file); 1143 1143 ··· 1146 1146 return 0; 1147 1147 } 1148 1148 1149 - return ops->vidioc_g_output(file, fh, arg); 1149 + return ops->vidioc_g_output(file, NULL, arg); 1150 1150 } 1151 1151 1152 - static int v4l_s_input(const struct v4l2_ioctl_ops *ops, 1153 - struct file *file, void *fh, void *arg) 1152 + static int v4l_s_input(const struct v4l2_ioctl_ops *ops, struct file *file, 1153 + void *arg) 1154 1154 { 1155 1155 struct video_device *vfd = video_devdata(file); 1156 1156 int ret; ··· 1162 1162 if (vfd->device_caps & V4L2_CAP_IO_MC) 1163 1163 return *(int *)arg ? -EINVAL : 0; 1164 1164 1165 - return ops->vidioc_s_input(file, fh, *(unsigned int *)arg); 1165 + return ops->vidioc_s_input(file, NULL, *(unsigned int *)arg); 1166 1166 } 1167 1167 1168 - static int v4l_s_output(const struct v4l2_ioctl_ops *ops, 1169 - struct file *file, void *fh, void *arg) 1168 + static int v4l_s_output(const struct v4l2_ioctl_ops *ops, struct file *file, 1169 + void *arg) 1170 1170 { 1171 1171 struct video_device *vfd = video_devdata(file); 1172 1172 1173 1173 if (vfd->device_caps & V4L2_CAP_IO_MC) 1174 1174 return *(int *)arg ? -EINVAL : 0; 1175 1175 1176 - return ops->vidioc_s_output(file, fh, *(unsigned int *)arg); 1176 + return ops->vidioc_s_output(file, NULL, *(unsigned int *)arg); 1177 1177 } 1178 1178 1179 - static int v4l_g_priority(const struct v4l2_ioctl_ops *ops, 1180 - struct file *file, void *fh, void *arg) 1179 + static int v4l_g_priority(const struct v4l2_ioctl_ops *ops, struct file *file, 1180 + void *arg) 1181 1181 { 1182 1182 struct video_device *vfd; 1183 1183 u32 *p = arg; ··· 1187 1187 return 0; 1188 1188 } 1189 1189 1190 - static int v4l_s_priority(const struct v4l2_ioctl_ops *ops, 1191 - struct file *file, void *fh, void *arg) 1190 + static int v4l_s_priority(const struct v4l2_ioctl_ops *ops, struct file *file, 1191 + void *arg) 1192 1192 { 1193 1193 struct video_device *vfd; 1194 1194 struct v4l2_fh *vfh; ··· 1199 1199 return v4l2_prio_change(vfd->prio, &vfh->prio, *p); 1200 1200 } 1201 1201 1202 - static int v4l_enuminput(const struct v4l2_ioctl_ops *ops, 1203 - struct file *file, void *fh, void *arg) 1202 + static int v4l_enuminput(const struct v4l2_ioctl_ops *ops, struct file *file, 1203 + void *arg) 1204 1204 { 1205 1205 struct video_device *vfd = video_devdata(file); 1206 1206 struct v4l2_input *p = arg; ··· 1222 1222 return 0; 1223 1223 } 1224 1224 1225 - return ops->vidioc_enum_input(file, fh, p); 1225 + return ops->vidioc_enum_input(file, NULL, p); 1226 1226 } 1227 1227 1228 - static int v4l_enumoutput(const struct v4l2_ioctl_ops *ops, 1229 - struct file *file, void *fh, void *arg) 1228 + static int v4l_enumoutput(const struct v4l2_ioctl_ops *ops, struct file *file, 1229 + void *arg) 1230 1230 { 1231 1231 struct video_device *vfd = video_devdata(file); 1232 1232 struct v4l2_output *p = arg; ··· 1248 1248 return 0; 1249 1249 } 1250 1250 1251 - return ops->vidioc_enum_output(file, fh, p); 1251 + return ops->vidioc_enum_output(file, NULL, p); 1252 1252 } 1253 1253 1254 1254 static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) ··· 1587 1587 fmt->flags |= flags; 1588 1588 } 1589 1589 1590 - static int v4l_enum_fmt(const struct v4l2_ioctl_ops *ops, 1591 - struct file *file, void *fh, void *arg) 1590 + static int v4l_enum_fmt(const struct v4l2_ioctl_ops *ops, struct file *file, 1591 + void *arg) 1592 1592 { 1593 1593 struct video_device *vdev = video_devdata(file); 1594 1594 struct v4l2_fmtdesc *p = arg; ··· 1618 1618 1619 1619 if (unlikely(!ops->vidioc_enum_fmt_vid_cap)) 1620 1620 break; 1621 - ret = ops->vidioc_enum_fmt_vid_cap(file, fh, arg); 1621 + ret = ops->vidioc_enum_fmt_vid_cap(file, NULL, arg); 1622 1622 break; 1623 1623 case V4L2_BUF_TYPE_VIDEO_OVERLAY: 1624 1624 if (unlikely(!ops->vidioc_enum_fmt_vid_overlay)) 1625 1625 break; 1626 - ret = ops->vidioc_enum_fmt_vid_overlay(file, fh, arg); 1626 + ret = ops->vidioc_enum_fmt_vid_overlay(file, NULL, arg); 1627 1627 break; 1628 1628 case V4L2_BUF_TYPE_VIDEO_OUTPUT: 1629 1629 case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: ··· 1635 1635 1636 1636 if (unlikely(!ops->vidioc_enum_fmt_vid_out)) 1637 1637 break; 1638 - ret = ops->vidioc_enum_fmt_vid_out(file, fh, arg); 1638 + ret = ops->vidioc_enum_fmt_vid_out(file, NULL, arg); 1639 1639 break; 1640 1640 case V4L2_BUF_TYPE_SDR_CAPTURE: 1641 1641 if (unlikely(!ops->vidioc_enum_fmt_sdr_cap)) 1642 1642 break; 1643 - ret = ops->vidioc_enum_fmt_sdr_cap(file, fh, arg); 1643 + ret = ops->vidioc_enum_fmt_sdr_cap(file, NULL, arg); 1644 1644 break; 1645 1645 case V4L2_BUF_TYPE_SDR_OUTPUT: 1646 1646 if (unlikely(!ops->vidioc_enum_fmt_sdr_out)) 1647 1647 break; 1648 - ret = ops->vidioc_enum_fmt_sdr_out(file, fh, arg); 1648 + ret = ops->vidioc_enum_fmt_sdr_out(file, NULL, arg); 1649 1649 break; 1650 1650 case V4L2_BUF_TYPE_META_CAPTURE: 1651 1651 if (unlikely(!ops->vidioc_enum_fmt_meta_cap)) 1652 1652 break; 1653 - ret = ops->vidioc_enum_fmt_meta_cap(file, fh, arg); 1653 + ret = ops->vidioc_enum_fmt_meta_cap(file, NULL, arg); 1654 1654 break; 1655 1655 case V4L2_BUF_TYPE_META_OUTPUT: 1656 1656 if (unlikely(!ops->vidioc_enum_fmt_meta_out)) 1657 1657 break; 1658 - ret = ops->vidioc_enum_fmt_meta_out(file, fh, arg); 1658 + ret = ops->vidioc_enum_fmt_meta_out(file, NULL, arg); 1659 1659 break; 1660 1660 } 1661 1661 if (ret == 0) ··· 1678 1678 p->xfer_func = 0; 1679 1679 } 1680 1680 1681 - static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops, 1682 - struct file *file, void *fh, void *arg) 1681 + static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops, struct file *file, 1682 + void *arg) 1683 1683 { 1684 1684 struct v4l2_format *p = arg; 1685 1685 struct video_device *vfd = video_devdata(file); ··· 1695 1695 if (unlikely(!ops->vidioc_g_fmt_vid_cap)) 1696 1696 break; 1697 1697 p->fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC; 1698 - ret = ops->vidioc_g_fmt_vid_cap(file, fh, arg); 1698 + ret = ops->vidioc_g_fmt_vid_cap(file, NULL, arg); 1699 1699 /* just in case the driver zeroed it again */ 1700 1700 p->fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC; 1701 1701 if (vfd->vfl_type == VFL_TYPE_TOUCH) 1702 1702 v4l_pix_format_touch(&p->fmt.pix); 1703 1703 return ret; 1704 1704 case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: 1705 - return ops->vidioc_g_fmt_vid_cap_mplane(file, fh, arg); 1705 + return ops->vidioc_g_fmt_vid_cap_mplane(file, NULL, arg); 1706 1706 case V4L2_BUF_TYPE_VIDEO_OVERLAY: 1707 - return ops->vidioc_g_fmt_vid_overlay(file, fh, arg); 1707 + return ops->vidioc_g_fmt_vid_overlay(file, NULL, arg); 1708 1708 case V4L2_BUF_TYPE_VBI_CAPTURE: 1709 - return ops->vidioc_g_fmt_vbi_cap(file, fh, arg); 1709 + return ops->vidioc_g_fmt_vbi_cap(file, NULL, arg); 1710 1710 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: 1711 - return ops->vidioc_g_fmt_sliced_vbi_cap(file, fh, arg); 1711 + return ops->vidioc_g_fmt_sliced_vbi_cap(file, NULL, arg); 1712 1712 case V4L2_BUF_TYPE_VIDEO_OUTPUT: 1713 1713 if (unlikely(!ops->vidioc_g_fmt_vid_out)) 1714 1714 break; 1715 1715 p->fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC; 1716 - ret = ops->vidioc_g_fmt_vid_out(file, fh, arg); 1716 + ret = ops->vidioc_g_fmt_vid_out(file, NULL, arg); 1717 1717 /* just in case the driver zeroed it again */ 1718 1718 p->fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC; 1719 1719 return ret; 1720 1720 case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: 1721 - return ops->vidioc_g_fmt_vid_out_mplane(file, fh, arg); 1721 + return ops->vidioc_g_fmt_vid_out_mplane(file, NULL, arg); 1722 1722 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: 1723 - return ops->vidioc_g_fmt_vid_out_overlay(file, fh, arg); 1723 + return ops->vidioc_g_fmt_vid_out_overlay(file, NULL, arg); 1724 1724 case V4L2_BUF_TYPE_VBI_OUTPUT: 1725 - return ops->vidioc_g_fmt_vbi_out(file, fh, arg); 1725 + return ops->vidioc_g_fmt_vbi_out(file, NULL, arg); 1726 1726 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: 1727 - return ops->vidioc_g_fmt_sliced_vbi_out(file, fh, arg); 1727 + return ops->vidioc_g_fmt_sliced_vbi_out(file, NULL, arg); 1728 1728 case V4L2_BUF_TYPE_SDR_CAPTURE: 1729 - return ops->vidioc_g_fmt_sdr_cap(file, fh, arg); 1729 + return ops->vidioc_g_fmt_sdr_cap(file, NULL, arg); 1730 1730 case V4L2_BUF_TYPE_SDR_OUTPUT: 1731 - return ops->vidioc_g_fmt_sdr_out(file, fh, arg); 1731 + return ops->vidioc_g_fmt_sdr_out(file, NULL, arg); 1732 1732 case V4L2_BUF_TYPE_META_CAPTURE: 1733 - return ops->vidioc_g_fmt_meta_cap(file, fh, arg); 1733 + return ops->vidioc_g_fmt_meta_cap(file, NULL, arg); 1734 1734 case V4L2_BUF_TYPE_META_OUTPUT: 1735 - return ops->vidioc_g_fmt_meta_out(file, fh, arg); 1735 + return ops->vidioc_g_fmt_meta_out(file, NULL, arg); 1736 1736 } 1737 1737 return -EINVAL; 1738 1738 } 1739 1739 1740 - static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops, 1741 - struct file *file, void *fh, void *arg) 1740 + static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops, struct file *file, 1741 + void *arg) 1742 1742 { 1743 1743 struct v4l2_format *p = arg; 1744 1744 struct video_device *vfd = video_devdata(file); ··· 1758 1758 if (unlikely(!ops->vidioc_s_fmt_vid_cap)) 1759 1759 break; 1760 1760 memset_after(p, 0, fmt.pix); 1761 - ret = ops->vidioc_s_fmt_vid_cap(file, fh, arg); 1761 + ret = ops->vidioc_s_fmt_vid_cap(file, NULL, arg); 1762 1762 /* just in case the driver zeroed it again */ 1763 1763 p->fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC; 1764 1764 if (vfd->vfl_type == VFL_TYPE_TOUCH) ··· 1771 1771 for (i = 0; i < p->fmt.pix_mp.num_planes; i++) 1772 1772 memset_after(&p->fmt.pix_mp.plane_fmt[i], 1773 1773 0, bytesperline); 1774 - return ops->vidioc_s_fmt_vid_cap_mplane(file, fh, arg); 1774 + return ops->vidioc_s_fmt_vid_cap_mplane(file, NULL, arg); 1775 1775 case V4L2_BUF_TYPE_VIDEO_OVERLAY: 1776 1776 if (unlikely(!ops->vidioc_s_fmt_vid_overlay)) 1777 1777 break; ··· 1779 1779 p->fmt.win.clips = NULL; 1780 1780 p->fmt.win.clipcount = 0; 1781 1781 p->fmt.win.bitmap = NULL; 1782 - return ops->vidioc_s_fmt_vid_overlay(file, fh, arg); 1782 + return ops->vidioc_s_fmt_vid_overlay(file, NULL, arg); 1783 1783 case V4L2_BUF_TYPE_VBI_CAPTURE: 1784 1784 if (unlikely(!ops->vidioc_s_fmt_vbi_cap)) 1785 1785 break; 1786 1786 memset_after(p, 0, fmt.vbi.flags); 1787 - return ops->vidioc_s_fmt_vbi_cap(file, fh, arg); 1787 + return ops->vidioc_s_fmt_vbi_cap(file, NULL, arg); 1788 1788 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: 1789 1789 if (unlikely(!ops->vidioc_s_fmt_sliced_vbi_cap)) 1790 1790 break; 1791 1791 memset_after(p, 0, fmt.sliced.io_size); 1792 - return ops->vidioc_s_fmt_sliced_vbi_cap(file, fh, arg); 1792 + return ops->vidioc_s_fmt_sliced_vbi_cap(file, NULL, arg); 1793 1793 case V4L2_BUF_TYPE_VIDEO_OUTPUT: 1794 1794 if (unlikely(!ops->vidioc_s_fmt_vid_out)) 1795 1795 break; 1796 1796 memset_after(p, 0, fmt.pix); 1797 - ret = ops->vidioc_s_fmt_vid_out(file, fh, arg); 1797 + ret = ops->vidioc_s_fmt_vid_out(file, NULL, arg); 1798 1798 /* just in case the driver zeroed it again */ 1799 1799 p->fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC; 1800 1800 return ret; ··· 1805 1805 for (i = 0; i < p->fmt.pix_mp.num_planes; i++) 1806 1806 memset_after(&p->fmt.pix_mp.plane_fmt[i], 1807 1807 0, bytesperline); 1808 - return ops->vidioc_s_fmt_vid_out_mplane(file, fh, arg); 1808 + return ops->vidioc_s_fmt_vid_out_mplane(file, NULL, arg); 1809 1809 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: 1810 1810 if (unlikely(!ops->vidioc_s_fmt_vid_out_overlay)) 1811 1811 break; ··· 1813 1813 p->fmt.win.clips = NULL; 1814 1814 p->fmt.win.clipcount = 0; 1815 1815 p->fmt.win.bitmap = NULL; 1816 - return ops->vidioc_s_fmt_vid_out_overlay(file, fh, arg); 1816 + return ops->vidioc_s_fmt_vid_out_overlay(file, NULL, arg); 1817 1817 case V4L2_BUF_TYPE_VBI_OUTPUT: 1818 1818 if (unlikely(!ops->vidioc_s_fmt_vbi_out)) 1819 1819 break; 1820 1820 memset_after(p, 0, fmt.vbi.flags); 1821 - return ops->vidioc_s_fmt_vbi_out(file, fh, arg); 1821 + return ops->vidioc_s_fmt_vbi_out(file, NULL, arg); 1822 1822 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: 1823 1823 if (unlikely(!ops->vidioc_s_fmt_sliced_vbi_out)) 1824 1824 break; 1825 1825 memset_after(p, 0, fmt.sliced.io_size); 1826 - return ops->vidioc_s_fmt_sliced_vbi_out(file, fh, arg); 1826 + return ops->vidioc_s_fmt_sliced_vbi_out(file, NULL, arg); 1827 1827 case V4L2_BUF_TYPE_SDR_CAPTURE: 1828 1828 if (unlikely(!ops->vidioc_s_fmt_sdr_cap)) 1829 1829 break; 1830 1830 memset_after(p, 0, fmt.sdr.buffersize); 1831 - return ops->vidioc_s_fmt_sdr_cap(file, fh, arg); 1831 + return ops->vidioc_s_fmt_sdr_cap(file, NULL, arg); 1832 1832 case V4L2_BUF_TYPE_SDR_OUTPUT: 1833 1833 if (unlikely(!ops->vidioc_s_fmt_sdr_out)) 1834 1834 break; 1835 1835 memset_after(p, 0, fmt.sdr.buffersize); 1836 - return ops->vidioc_s_fmt_sdr_out(file, fh, arg); 1836 + return ops->vidioc_s_fmt_sdr_out(file, NULL, arg); 1837 1837 case V4L2_BUF_TYPE_META_CAPTURE: 1838 1838 if (unlikely(!ops->vidioc_s_fmt_meta_cap)) 1839 1839 break; 1840 1840 memset_after(p, 0, fmt.meta); 1841 - return ops->vidioc_s_fmt_meta_cap(file, fh, arg); 1841 + return ops->vidioc_s_fmt_meta_cap(file, NULL, arg); 1842 1842 case V4L2_BUF_TYPE_META_OUTPUT: 1843 1843 if (unlikely(!ops->vidioc_s_fmt_meta_out)) 1844 1844 break; 1845 1845 memset_after(p, 0, fmt.meta); 1846 - return ops->vidioc_s_fmt_meta_out(file, fh, arg); 1846 + return ops->vidioc_s_fmt_meta_out(file, NULL, arg); 1847 1847 } 1848 1848 return -EINVAL; 1849 1849 } 1850 1850 1851 - static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops, 1852 - struct file *file, void *fh, void *arg) 1851 + static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops, struct file *file, 1852 + void *arg) 1853 1853 { 1854 1854 struct v4l2_format *p = arg; 1855 1855 struct video_device *vfd = video_devdata(file); ··· 1866 1866 if (unlikely(!ops->vidioc_try_fmt_vid_cap)) 1867 1867 break; 1868 1868 memset_after(p, 0, fmt.pix); 1869 - ret = ops->vidioc_try_fmt_vid_cap(file, fh, arg); 1869 + ret = ops->vidioc_try_fmt_vid_cap(file, NULL, arg); 1870 1870 /* just in case the driver zeroed it again */ 1871 1871 p->fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC; 1872 1872 if (vfd->vfl_type == VFL_TYPE_TOUCH) ··· 1879 1879 for (i = 0; i < p->fmt.pix_mp.num_planes; i++) 1880 1880 memset_after(&p->fmt.pix_mp.plane_fmt[i], 1881 1881 0, bytesperline); 1882 - return ops->vidioc_try_fmt_vid_cap_mplane(file, fh, arg); 1882 + return ops->vidioc_try_fmt_vid_cap_mplane(file, NULL, arg); 1883 1883 case V4L2_BUF_TYPE_VIDEO_OVERLAY: 1884 1884 if (unlikely(!ops->vidioc_try_fmt_vid_overlay)) 1885 1885 break; ··· 1887 1887 p->fmt.win.clips = NULL; 1888 1888 p->fmt.win.clipcount = 0; 1889 1889 p->fmt.win.bitmap = NULL; 1890 - return ops->vidioc_try_fmt_vid_overlay(file, fh, arg); 1890 + return ops->vidioc_try_fmt_vid_overlay(file, NULL, arg); 1891 1891 case V4L2_BUF_TYPE_VBI_CAPTURE: 1892 1892 if (unlikely(!ops->vidioc_try_fmt_vbi_cap)) 1893 1893 break; 1894 1894 memset_after(p, 0, fmt.vbi.flags); 1895 - return ops->vidioc_try_fmt_vbi_cap(file, fh, arg); 1895 + return ops->vidioc_try_fmt_vbi_cap(file, NULL, arg); 1896 1896 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: 1897 1897 if (unlikely(!ops->vidioc_try_fmt_sliced_vbi_cap)) 1898 1898 break; 1899 1899 memset_after(p, 0, fmt.sliced.io_size); 1900 - return ops->vidioc_try_fmt_sliced_vbi_cap(file, fh, arg); 1900 + return ops->vidioc_try_fmt_sliced_vbi_cap(file, NULL, arg); 1901 1901 case V4L2_BUF_TYPE_VIDEO_OUTPUT: 1902 1902 if (unlikely(!ops->vidioc_try_fmt_vid_out)) 1903 1903 break; 1904 1904 memset_after(p, 0, fmt.pix); 1905 - ret = ops->vidioc_try_fmt_vid_out(file, fh, arg); 1905 + ret = ops->vidioc_try_fmt_vid_out(file, NULL, arg); 1906 1906 /* just in case the driver zeroed it again */ 1907 1907 p->fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC; 1908 1908 return ret; ··· 1913 1913 for (i = 0; i < p->fmt.pix_mp.num_planes; i++) 1914 1914 memset_after(&p->fmt.pix_mp.plane_fmt[i], 1915 1915 0, bytesperline); 1916 - return ops->vidioc_try_fmt_vid_out_mplane(file, fh, arg); 1916 + return ops->vidioc_try_fmt_vid_out_mplane(file, NULL, arg); 1917 1917 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: 1918 1918 if (unlikely(!ops->vidioc_try_fmt_vid_out_overlay)) 1919 1919 break; ··· 1921 1921 p->fmt.win.clips = NULL; 1922 1922 p->fmt.win.clipcount = 0; 1923 1923 p->fmt.win.bitmap = NULL; 1924 - return ops->vidioc_try_fmt_vid_out_overlay(file, fh, arg); 1924 + return ops->vidioc_try_fmt_vid_out_overlay(file, NULL, arg); 1925 1925 case V4L2_BUF_TYPE_VBI_OUTPUT: 1926 1926 if (unlikely(!ops->vidioc_try_fmt_vbi_out)) 1927 1927 break; 1928 1928 memset_after(p, 0, fmt.vbi.flags); 1929 - return ops->vidioc_try_fmt_vbi_out(file, fh, arg); 1929 + return ops->vidioc_try_fmt_vbi_out(file, NULL, arg); 1930 1930 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: 1931 1931 if (unlikely(!ops->vidioc_try_fmt_sliced_vbi_out)) 1932 1932 break; 1933 1933 memset_after(p, 0, fmt.sliced.io_size); 1934 - return ops->vidioc_try_fmt_sliced_vbi_out(file, fh, arg); 1934 + return ops->vidioc_try_fmt_sliced_vbi_out(file, NULL, arg); 1935 1935 case V4L2_BUF_TYPE_SDR_CAPTURE: 1936 1936 if (unlikely(!ops->vidioc_try_fmt_sdr_cap)) 1937 1937 break; 1938 1938 memset_after(p, 0, fmt.sdr.buffersize); 1939 - return ops->vidioc_try_fmt_sdr_cap(file, fh, arg); 1939 + return ops->vidioc_try_fmt_sdr_cap(file, NULL, arg); 1940 1940 case V4L2_BUF_TYPE_SDR_OUTPUT: 1941 1941 if (unlikely(!ops->vidioc_try_fmt_sdr_out)) 1942 1942 break; 1943 1943 memset_after(p, 0, fmt.sdr.buffersize); 1944 - return ops->vidioc_try_fmt_sdr_out(file, fh, arg); 1944 + return ops->vidioc_try_fmt_sdr_out(file, NULL, arg); 1945 1945 case V4L2_BUF_TYPE_META_CAPTURE: 1946 1946 if (unlikely(!ops->vidioc_try_fmt_meta_cap)) 1947 1947 break; 1948 1948 memset_after(p, 0, fmt.meta); 1949 - return ops->vidioc_try_fmt_meta_cap(file, fh, arg); 1949 + return ops->vidioc_try_fmt_meta_cap(file, NULL, arg); 1950 1950 case V4L2_BUF_TYPE_META_OUTPUT: 1951 1951 if (unlikely(!ops->vidioc_try_fmt_meta_out)) 1952 1952 break; 1953 1953 memset_after(p, 0, fmt.meta); 1954 - return ops->vidioc_try_fmt_meta_out(file, fh, arg); 1954 + return ops->vidioc_try_fmt_meta_out(file, NULL, arg); 1955 1955 } 1956 1956 return -EINVAL; 1957 1957 } 1958 1958 1959 - static int v4l_streamon(const struct v4l2_ioctl_ops *ops, 1960 - struct file *file, void *fh, void *arg) 1959 + static int v4l_streamon(const struct v4l2_ioctl_ops *ops, struct file *file, 1960 + void *arg) 1961 1961 { 1962 - return ops->vidioc_streamon(file, fh, *(unsigned int *)arg); 1962 + return ops->vidioc_streamon(file, NULL, *(unsigned int *)arg); 1963 1963 } 1964 1964 1965 - static int v4l_streamoff(const struct v4l2_ioctl_ops *ops, 1966 - struct file *file, void *fh, void *arg) 1965 + static int v4l_streamoff(const struct v4l2_ioctl_ops *ops, struct file *file, 1966 + void *arg) 1967 1967 { 1968 - return ops->vidioc_streamoff(file, fh, *(unsigned int *)arg); 1968 + return ops->vidioc_streamoff(file, NULL, *(unsigned int *)arg); 1969 1969 } 1970 1970 1971 - static int v4l_g_tuner(const struct v4l2_ioctl_ops *ops, 1972 - struct file *file, void *fh, void *arg) 1971 + static int v4l_g_tuner(const struct v4l2_ioctl_ops *ops, struct file *file, 1972 + void *arg) 1973 1973 { 1974 1974 struct video_device *vfd = video_devdata(file); 1975 1975 struct v4l2_tuner *p = arg; ··· 1977 1977 1978 1978 p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ? 1979 1979 V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; 1980 - err = ops->vidioc_g_tuner(file, fh, p); 1980 + err = ops->vidioc_g_tuner(file, NULL, p); 1981 1981 if (!err) 1982 1982 p->capability |= V4L2_TUNER_CAP_FREQ_BANDS; 1983 1983 return err; 1984 1984 } 1985 1985 1986 - static int v4l_s_tuner(const struct v4l2_ioctl_ops *ops, 1987 - struct file *file, void *fh, void *arg) 1986 + static int v4l_s_tuner(const struct v4l2_ioctl_ops *ops, struct file *file, 1987 + void *arg) 1988 1988 { 1989 1989 struct video_device *vfd = video_devdata(file); 1990 1990 struct v4l2_tuner *p = arg; ··· 1995 1995 return ret; 1996 1996 p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ? 1997 1997 V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; 1998 - return ops->vidioc_s_tuner(file, fh, p); 1998 + return ops->vidioc_s_tuner(file, NULL, p); 1999 1999 } 2000 2000 2001 2001 static int v4l_g_modulator(const struct v4l2_ioctl_ops *ops, 2002 - struct file *file, void *fh, void *arg) 2002 + struct file *file, void *arg) 2003 2003 { 2004 2004 struct video_device *vfd = video_devdata(file); 2005 2005 struct v4l2_modulator *p = arg; ··· 2008 2008 if (vfd->vfl_type == VFL_TYPE_RADIO) 2009 2009 p->type = V4L2_TUNER_RADIO; 2010 2010 2011 - err = ops->vidioc_g_modulator(file, fh, p); 2011 + err = ops->vidioc_g_modulator(file, NULL, p); 2012 2012 if (!err) 2013 2013 p->capability |= V4L2_TUNER_CAP_FREQ_BANDS; 2014 2014 return err; 2015 2015 } 2016 2016 2017 2017 static int v4l_s_modulator(const struct v4l2_ioctl_ops *ops, 2018 - struct file *file, void *fh, void *arg) 2018 + struct file *file, void *arg) 2019 2019 { 2020 2020 struct video_device *vfd = video_devdata(file); 2021 2021 struct v4l2_modulator *p = arg; ··· 2023 2023 if (vfd->vfl_type == VFL_TYPE_RADIO) 2024 2024 p->type = V4L2_TUNER_RADIO; 2025 2025 2026 - return ops->vidioc_s_modulator(file, fh, p); 2026 + return ops->vidioc_s_modulator(file, NULL, p); 2027 2027 } 2028 2028 2029 2029 static int v4l_g_frequency(const struct v4l2_ioctl_ops *ops, 2030 - struct file *file, void *fh, void *arg) 2030 + struct file *file, void *arg) 2031 2031 { 2032 2032 struct video_device *vfd = video_devdata(file); 2033 2033 struct v4l2_frequency *p = arg; ··· 2037 2037 else 2038 2038 p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ? 2039 2039 V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; 2040 - return ops->vidioc_g_frequency(file, fh, p); 2040 + return ops->vidioc_g_frequency(file, NULL, p); 2041 2041 } 2042 2042 2043 2043 static int v4l_s_frequency(const struct v4l2_ioctl_ops *ops, 2044 - struct file *file, void *fh, void *arg) 2044 + struct file *file, void *arg) 2045 2045 { 2046 2046 struct video_device *vfd = video_devdata(file); 2047 2047 const struct v4l2_frequency *p = arg; ··· 2060 2060 if (type != p->type) 2061 2061 return -EINVAL; 2062 2062 } 2063 - return ops->vidioc_s_frequency(file, fh, p); 2063 + return ops->vidioc_s_frequency(file, NULL, p); 2064 2064 } 2065 2065 2066 - static int v4l_enumstd(const struct v4l2_ioctl_ops *ops, 2067 - struct file *file, void *fh, void *arg) 2066 + static int v4l_enumstd(const struct v4l2_ioctl_ops *ops, struct file *file, 2067 + void *arg) 2068 2068 { 2069 2069 struct video_device *vfd = video_devdata(file); 2070 2070 struct v4l2_standard *p = arg; ··· 2072 2072 return v4l_video_std_enumstd(p, vfd->tvnorms); 2073 2073 } 2074 2074 2075 - static int v4l_s_std(const struct v4l2_ioctl_ops *ops, 2076 - struct file *file, void *fh, void *arg) 2075 + static int v4l_s_std(const struct v4l2_ioctl_ops *ops, struct file *file, 2076 + void *arg) 2077 2077 { 2078 2078 struct video_device *vfd = video_devdata(file); 2079 2079 v4l2_std_id id = *(v4l2_std_id *)arg, norm; ··· 2087 2087 return -EINVAL; 2088 2088 2089 2089 /* Calls the specific handler */ 2090 - return ops->vidioc_s_std(file, fh, norm); 2090 + return ops->vidioc_s_std(file, NULL, norm); 2091 2091 } 2092 2092 2093 - static int v4l_querystd(const struct v4l2_ioctl_ops *ops, 2094 - struct file *file, void *fh, void *arg) 2093 + static int v4l_querystd(const struct v4l2_ioctl_ops *ops, struct file *file, 2094 + void *arg) 2095 2095 { 2096 2096 struct video_device *vfd = video_devdata(file); 2097 2097 v4l2_std_id *p = arg; ··· 2109 2109 * their efforts to improve the standards detection. 2110 2110 */ 2111 2111 *p = vfd->tvnorms; 2112 - return ops->vidioc_querystd(file, fh, arg); 2112 + return ops->vidioc_querystd(file, NULL, arg); 2113 2113 } 2114 2114 2115 2115 static int v4l_s_hw_freq_seek(const struct v4l2_ioctl_ops *ops, 2116 - struct file *file, void *fh, void *arg) 2116 + struct file *file, void *arg) 2117 2117 { 2118 2118 struct video_device *vfd = video_devdata(file); 2119 2119 struct v4l2_hw_freq_seek *p = arg; ··· 2131 2131 V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; 2132 2132 if (p->type != type) 2133 2133 return -EINVAL; 2134 - return ops->vidioc_s_hw_freq_seek(file, fh, p); 2134 + return ops->vidioc_s_hw_freq_seek(file, NULL, p); 2135 2135 } 2136 2136 2137 - static int v4l_s_fbuf(const struct v4l2_ioctl_ops *ops, 2138 - struct file *file, void *fh, void *arg) 2137 + static int v4l_s_fbuf(const struct v4l2_ioctl_ops *ops, struct file *file, 2138 + void *arg) 2139 2139 { 2140 2140 struct v4l2_framebuffer *p = arg; 2141 2141 2142 2142 p->base = NULL; 2143 - return ops->vidioc_s_fbuf(file, fh, p); 2143 + return ops->vidioc_s_fbuf(file, NULL, p); 2144 2144 } 2145 2145 2146 - static int v4l_overlay(const struct v4l2_ioctl_ops *ops, 2147 - struct file *file, void *fh, void *arg) 2146 + static int v4l_overlay(const struct v4l2_ioctl_ops *ops, struct file *file, 2147 + void *arg) 2148 2148 { 2149 - return ops->vidioc_overlay(file, fh, *(unsigned int *)arg); 2149 + return ops->vidioc_overlay(file, NULL, *(unsigned int *)arg); 2150 2150 } 2151 2151 2152 - static int v4l_reqbufs(const struct v4l2_ioctl_ops *ops, 2153 - struct file *file, void *fh, void *arg) 2152 + static int v4l_reqbufs(const struct v4l2_ioctl_ops *ops, struct file *file, 2153 + void *arg) 2154 2154 { 2155 2155 struct video_device *vfd = video_devdata(file); 2156 2156 struct v4l2_requestbuffers *p = arg; ··· 2165 2165 if (is_valid_ioctl(vfd, VIDIOC_REMOVE_BUFS)) 2166 2166 p->capabilities = V4L2_BUF_CAP_SUPPORTS_REMOVE_BUFS; 2167 2167 2168 - return ops->vidioc_reqbufs(file, fh, p); 2168 + return ops->vidioc_reqbufs(file, NULL, p); 2169 2169 } 2170 2170 2171 - static int v4l_querybuf(const struct v4l2_ioctl_ops *ops, 2172 - struct file *file, void *fh, void *arg) 2171 + static int v4l_querybuf(const struct v4l2_ioctl_ops *ops, struct file *file, 2172 + void *arg) 2173 2173 { 2174 2174 struct v4l2_buffer *p = arg; 2175 2175 int ret = check_fmt(file, p->type); 2176 2176 2177 - return ret ? ret : ops->vidioc_querybuf(file, fh, p); 2177 + return ret ? ret : ops->vidioc_querybuf(file, NULL, p); 2178 2178 } 2179 2179 2180 - static int v4l_qbuf(const struct v4l2_ioctl_ops *ops, 2181 - struct file *file, void *fh, void *arg) 2180 + static int v4l_qbuf(const struct v4l2_ioctl_ops *ops, struct file *file, 2181 + void *arg) 2182 2182 { 2183 2183 struct v4l2_buffer *p = arg; 2184 2184 int ret = check_fmt(file, p->type); 2185 2185 2186 - return ret ? ret : ops->vidioc_qbuf(file, fh, p); 2186 + return ret ? ret : ops->vidioc_qbuf(file, NULL, p); 2187 2187 } 2188 2188 2189 - static int v4l_dqbuf(const struct v4l2_ioctl_ops *ops, 2190 - struct file *file, void *fh, void *arg) 2189 + static int v4l_dqbuf(const struct v4l2_ioctl_ops *ops, struct file *file, 2190 + void *arg) 2191 2191 { 2192 2192 struct v4l2_buffer *p = arg; 2193 2193 int ret = check_fmt(file, p->type); 2194 2194 2195 - return ret ? ret : ops->vidioc_dqbuf(file, fh, p); 2195 + return ret ? ret : ops->vidioc_dqbuf(file, NULL, p); 2196 2196 } 2197 2197 2198 2198 static int v4l_create_bufs(const struct v4l2_ioctl_ops *ops, 2199 - struct file *file, void *fh, void *arg) 2199 + struct file *file, void *arg) 2200 2200 { 2201 2201 struct video_device *vfd = video_devdata(file); 2202 2202 struct v4l2_create_buffers *create = arg; ··· 2213 2213 if (is_valid_ioctl(vfd, VIDIOC_REMOVE_BUFS)) 2214 2214 create->capabilities = V4L2_BUF_CAP_SUPPORTS_REMOVE_BUFS; 2215 2215 2216 - ret = ops->vidioc_create_bufs(file, fh, create); 2216 + ret = ops->vidioc_create_bufs(file, NULL, create); 2217 2217 2218 2218 if (create->format.type == V4L2_BUF_TYPE_VIDEO_CAPTURE || 2219 2219 create->format.type == V4L2_BUF_TYPE_VIDEO_OUTPUT) ··· 2223 2223 } 2224 2224 2225 2225 static int v4l_prepare_buf(const struct v4l2_ioctl_ops *ops, 2226 - struct file *file, void *fh, void *arg) 2226 + struct file *file, void *arg) 2227 2227 { 2228 2228 struct v4l2_buffer *b = arg; 2229 2229 int ret = check_fmt(file, b->type); 2230 2230 2231 - return ret ? ret : ops->vidioc_prepare_buf(file, fh, b); 2231 + return ret ? ret : ops->vidioc_prepare_buf(file, NULL, b); 2232 2232 } 2233 2233 2234 2234 static int v4l_remove_bufs(const struct v4l2_ioctl_ops *ops, 2235 - struct file *file, void *fh, void *arg) 2235 + struct file *file, void *arg) 2236 2236 { 2237 2237 struct v4l2_remove_buffers *remove = arg; 2238 2238 2239 2239 if (ops->vidioc_remove_bufs) 2240 - return ops->vidioc_remove_bufs(file, fh, remove); 2240 + return ops->vidioc_remove_bufs(file, NULL, remove); 2241 2241 2242 2242 return -ENOTTY; 2243 2243 } 2244 2244 2245 - static int v4l_g_parm(const struct v4l2_ioctl_ops *ops, 2246 - struct file *file, void *fh, void *arg) 2245 + static int v4l_g_parm(const struct v4l2_ioctl_ops *ops, struct file *file, 2246 + void *arg) 2247 2247 { 2248 2248 struct video_device *vfd = video_devdata(file); 2249 2249 struct v4l2_streamparm *p = arg; ··· 2253 2253 if (ret) 2254 2254 return ret; 2255 2255 if (ops->vidioc_g_parm) 2256 - return ops->vidioc_g_parm(file, fh, p); 2256 + return ops->vidioc_g_parm(file, NULL, p); 2257 2257 if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && 2258 2258 p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) 2259 2259 return -EINVAL; 2260 2260 if (vfd->device_caps & V4L2_CAP_READWRITE) 2261 2261 p->parm.capture.readbuffers = 2; 2262 - ret = ops->vidioc_g_std(file, fh, &std); 2262 + ret = ops->vidioc_g_std(file, NULL, &std); 2263 2263 if (ret == 0) 2264 2264 v4l2_video_std_frame_period(std, &p->parm.capture.timeperframe); 2265 2265 return ret; 2266 2266 } 2267 2267 2268 - static int v4l_s_parm(const struct v4l2_ioctl_ops *ops, 2269 - struct file *file, void *fh, void *arg) 2268 + static int v4l_s_parm(const struct v4l2_ioctl_ops *ops, struct file *file, 2269 + void *arg) 2270 2270 { 2271 2271 struct v4l2_streamparm *p = arg; 2272 2272 int ret = check_fmt(file, p->type); ··· 2286 2286 p->parm.capture.extendedmode = 0; 2287 2287 p->parm.capture.capturemode &= V4L2_MODE_HIGHQUALITY; 2288 2288 } 2289 - return ops->vidioc_s_parm(file, fh, p); 2289 + return ops->vidioc_s_parm(file, NULL, p); 2290 2290 } 2291 2291 2292 - static int v4l_queryctrl(const struct v4l2_ioctl_ops *ops, 2293 - struct file *file, void *fh, void *arg) 2292 + static int v4l_queryctrl(const struct v4l2_ioctl_ops *ops, struct file *file, 2293 + void *arg) 2294 2294 { 2295 2295 struct video_device *vfd = video_devdata(file); 2296 2296 struct v4l2_query_ext_ctrl qec = {}; ··· 2307 2307 2308 2308 /* Simulate query_ext_ctr using query_ctrl. */ 2309 2309 qec.id = p->id; 2310 - ret = ops->vidioc_query_ext_ctrl(file, fh, &qec); 2310 + ret = ops->vidioc_query_ext_ctrl(file, NULL, &qec); 2311 2311 if (ret) 2312 2312 return ret; 2313 2313 v4l2_query_ext_ctrl_to_v4l2_queryctrl(p, &qec); ··· 2315 2315 } 2316 2316 2317 2317 static int v4l_query_ext_ctrl(const struct v4l2_ioctl_ops *ops, 2318 - struct file *file, void *fh, void *arg) 2318 + struct file *file, void *arg) 2319 2319 { 2320 2320 struct video_device *vfd = video_devdata(file); 2321 2321 struct v4l2_query_ext_ctrl *p = arg; ··· 2326 2326 if (vfd->ctrl_handler) 2327 2327 return v4l2_query_ext_ctrl(vfd->ctrl_handler, p); 2328 2328 if (ops->vidioc_query_ext_ctrl) 2329 - return ops->vidioc_query_ext_ctrl(file, fh, p); 2329 + return ops->vidioc_query_ext_ctrl(file, NULL, p); 2330 2330 return -ENOTTY; 2331 2331 } 2332 2332 2333 - static int v4l_querymenu(const struct v4l2_ioctl_ops *ops, 2334 - struct file *file, void *fh, void *arg) 2333 + static int v4l_querymenu(const struct v4l2_ioctl_ops *ops, struct file *file, 2334 + void *arg) 2335 2335 { 2336 2336 struct video_device *vfd = video_devdata(file); 2337 2337 struct v4l2_querymenu *p = arg; ··· 2342 2342 if (vfd->ctrl_handler) 2343 2343 return v4l2_querymenu(vfd->ctrl_handler, p); 2344 2344 if (ops->vidioc_querymenu) 2345 - return ops->vidioc_querymenu(file, fh, p); 2345 + return ops->vidioc_querymenu(file, NULL, p); 2346 2346 return -ENOTTY; 2347 2347 } 2348 2348 2349 - static int v4l_g_ctrl(const struct v4l2_ioctl_ops *ops, 2350 - struct file *file, void *fh, void *arg) 2349 + static int v4l_g_ctrl(const struct v4l2_ioctl_ops *ops, struct file *file, 2350 + void *arg) 2351 2351 { 2352 2352 struct video_device *vfd = video_devdata(file); 2353 2353 struct v4l2_control *p = arg; ··· 2368 2368 ctrl.id = p->id; 2369 2369 ctrl.value = p->value; 2370 2370 if (check_ext_ctrls(&ctrls, VIDIOC_G_CTRL)) { 2371 - int ret = ops->vidioc_g_ext_ctrls(file, fh, &ctrls); 2371 + int ret = ops->vidioc_g_ext_ctrls(file, NULL, &ctrls); 2372 2372 2373 2373 if (ret == 0) 2374 2374 p->value = ctrl.value; ··· 2377 2377 return -EINVAL; 2378 2378 } 2379 2379 2380 - static int v4l_s_ctrl(const struct v4l2_ioctl_ops *ops, 2381 - struct file *file, void *fh, void *arg) 2380 + static int v4l_s_ctrl(const struct v4l2_ioctl_ops *ops, struct file *file, 2381 + void *arg) 2382 2382 { 2383 2383 struct video_device *vfd = video_devdata(file); 2384 2384 struct v4l2_control *p = arg; ··· 2401 2401 ctrl.value = p->value; 2402 2402 if (!check_ext_ctrls(&ctrls, VIDIOC_S_CTRL)) 2403 2403 return -EINVAL; 2404 - ret = ops->vidioc_s_ext_ctrls(file, fh, &ctrls); 2404 + ret = ops->vidioc_s_ext_ctrls(file, NULL, &ctrls); 2405 2405 p->value = ctrl.value; 2406 2406 return ret; 2407 2407 } 2408 2408 2409 2409 static int v4l_g_ext_ctrls(const struct v4l2_ioctl_ops *ops, 2410 - struct file *file, void *fh, void *arg) 2410 + struct file *file, void *arg) 2411 2411 { 2412 2412 struct video_device *vfd = video_devdata(file); 2413 2413 struct v4l2_ext_controls *p = arg; ··· 2423 2423 if (ops->vidioc_g_ext_ctrls == NULL) 2424 2424 return -ENOTTY; 2425 2425 return check_ext_ctrls(p, VIDIOC_G_EXT_CTRLS) ? 2426 - ops->vidioc_g_ext_ctrls(file, fh, p) : -EINVAL; 2426 + ops->vidioc_g_ext_ctrls(file, NULL, p) : -EINVAL; 2427 2427 } 2428 2428 2429 2429 static int v4l_s_ext_ctrls(const struct v4l2_ioctl_ops *ops, 2430 - struct file *file, void *fh, void *arg) 2430 + struct file *file, void *arg) 2431 2431 { 2432 2432 struct video_device *vfd = video_devdata(file); 2433 2433 struct v4l2_ext_controls *p = arg; ··· 2443 2443 if (ops->vidioc_s_ext_ctrls == NULL) 2444 2444 return -ENOTTY; 2445 2445 return check_ext_ctrls(p, VIDIOC_S_EXT_CTRLS) ? 2446 - ops->vidioc_s_ext_ctrls(file, fh, p) : -EINVAL; 2446 + ops->vidioc_s_ext_ctrls(file, NULL, p) : -EINVAL; 2447 2447 } 2448 2448 2449 2449 static int v4l_try_ext_ctrls(const struct v4l2_ioctl_ops *ops, 2450 - struct file *file, void *fh, void *arg) 2450 + struct file *file, void *arg) 2451 2451 { 2452 2452 struct video_device *vfd = video_devdata(file); 2453 2453 struct v4l2_ext_controls *p = arg; ··· 2463 2463 if (ops->vidioc_try_ext_ctrls == NULL) 2464 2464 return -ENOTTY; 2465 2465 return check_ext_ctrls(p, VIDIOC_TRY_EXT_CTRLS) ? 2466 - ops->vidioc_try_ext_ctrls(file, fh, p) : -EINVAL; 2466 + ops->vidioc_try_ext_ctrls(file, NULL, p) : -EINVAL; 2467 2467 } 2468 2468 2469 2469 /* ··· 2476 2476 * type and drivers don't need to check for both. 2477 2477 */ 2478 2478 static int v4l_g_selection(const struct v4l2_ioctl_ops *ops, 2479 - struct file *file, void *fh, void *arg) 2479 + struct file *file, void *arg) 2480 2480 { 2481 2481 struct v4l2_selection *p = arg; 2482 2482 u32 old_type = p->type; ··· 2486 2486 p->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 2487 2487 else if (p->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) 2488 2488 p->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; 2489 - ret = ops->vidioc_g_selection(file, fh, p); 2489 + ret = ops->vidioc_g_selection(file, NULL, p); 2490 2490 p->type = old_type; 2491 2491 return ret; 2492 2492 } 2493 2493 2494 2494 static int v4l_s_selection(const struct v4l2_ioctl_ops *ops, 2495 - struct file *file, void *fh, void *arg) 2495 + struct file *file, void *arg) 2496 2496 { 2497 2497 struct v4l2_selection *p = arg; 2498 2498 u32 old_type = p->type; ··· 2502 2502 p->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 2503 2503 else if (p->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) 2504 2504 p->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; 2505 - ret = ops->vidioc_s_selection(file, fh, p); 2505 + ret = ops->vidioc_s_selection(file, NULL, p); 2506 2506 p->type = old_type; 2507 2507 return ret; 2508 2508 } 2509 2509 2510 - static int v4l_g_crop(const struct v4l2_ioctl_ops *ops, 2511 - struct file *file, void *fh, void *arg) 2510 + static int v4l_g_crop(const struct v4l2_ioctl_ops *ops, struct file *file, 2511 + void *arg) 2512 2512 { 2513 2513 struct video_device *vfd = video_devdata(file); 2514 2514 struct v4l2_crop *p = arg; ··· 2529 2529 s.target = s.target == V4L2_SEL_TGT_COMPOSE ? 2530 2530 V4L2_SEL_TGT_CROP : V4L2_SEL_TGT_COMPOSE; 2531 2531 2532 - ret = v4l_g_selection(ops, file, fh, &s); 2532 + ret = v4l_g_selection(ops, file, &s); 2533 2533 2534 2534 /* copying results to old structure on success */ 2535 2535 if (!ret) ··· 2537 2537 return ret; 2538 2538 } 2539 2539 2540 - static int v4l_s_crop(const struct v4l2_ioctl_ops *ops, 2541 - struct file *file, void *fh, void *arg) 2540 + static int v4l_s_crop(const struct v4l2_ioctl_ops *ops, struct file *file, 2541 + void *arg) 2542 2542 { 2543 2543 struct video_device *vfd = video_devdata(file); 2544 2544 struct v4l2_crop *p = arg; ··· 2559 2559 s.target = s.target == V4L2_SEL_TGT_COMPOSE ? 2560 2560 V4L2_SEL_TGT_CROP : V4L2_SEL_TGT_COMPOSE; 2561 2561 2562 - return v4l_s_selection(ops, file, fh, &s); 2562 + return v4l_s_selection(ops, file, &s); 2563 2563 } 2564 2564 2565 - static int v4l_cropcap(const struct v4l2_ioctl_ops *ops, 2566 - struct file *file, void *fh, void *arg) 2565 + static int v4l_cropcap(const struct v4l2_ioctl_ops *ops, struct file *file, 2566 + void *arg) 2567 2567 { 2568 2568 struct video_device *vfd = video_devdata(file); 2569 2569 struct v4l2_cropcap *p = arg; ··· 2587 2587 return -ENOTTY; 2588 2588 2589 2589 if (ops->vidioc_g_pixelaspect) 2590 - ret = ops->vidioc_g_pixelaspect(file, fh, s.type, 2590 + ret = ops->vidioc_g_pixelaspect(file, NULL, s.type, 2591 2591 &p->pixelaspect); 2592 2592 2593 2593 /* ··· 2609 2609 s.target = s.target == V4L2_SEL_TGT_COMPOSE_BOUNDS ? 2610 2610 V4L2_SEL_TGT_CROP_BOUNDS : V4L2_SEL_TGT_COMPOSE_BOUNDS; 2611 2611 2612 - ret = v4l_g_selection(ops, file, fh, &s); 2612 + ret = v4l_g_selection(ops, file, &s); 2613 2613 if (ret) 2614 2614 return ret; 2615 2615 p->bounds = s.r; ··· 2620 2620 else 2621 2621 s.target = V4L2_SEL_TGT_CROP_DEFAULT; 2622 2622 2623 - ret = v4l_g_selection(ops, file, fh, &s); 2623 + ret = v4l_g_selection(ops, file, &s); 2624 2624 if (ret) 2625 2625 return ret; 2626 2626 p->defrect = s.r; ··· 2628 2628 return 0; 2629 2629 } 2630 2630 2631 - static int v4l_log_status(const struct v4l2_ioctl_ops *ops, 2632 - struct file *file, void *fh, void *arg) 2631 + static int v4l_log_status(const struct v4l2_ioctl_ops *ops, struct file *file, 2632 + void *arg) 2633 2633 { 2634 2634 struct video_device *vfd = video_devdata(file); 2635 2635 int ret; ··· 2637 2637 if (vfd->v4l2_dev) 2638 2638 pr_info("%s: ================= START STATUS =================\n", 2639 2639 vfd->v4l2_dev->name); 2640 - ret = ops->vidioc_log_status(file, fh); 2640 + ret = ops->vidioc_log_status(file, NULL); 2641 2641 if (vfd->v4l2_dev) 2642 2642 pr_info("%s: ================== END STATUS ==================\n", 2643 2643 vfd->v4l2_dev->name); ··· 2645 2645 } 2646 2646 2647 2647 static int v4l_dbg_g_register(const struct v4l2_ioctl_ops *ops, 2648 - struct file *file, void *fh, void *arg) 2648 + struct file *file, void *arg) 2649 2649 { 2650 2650 #ifdef CONFIG_VIDEO_ADV_DEBUG 2651 2651 struct v4l2_dbg_register *p = arg; ··· 2665 2665 } 2666 2666 if (ops->vidioc_g_register && p->match.type == V4L2_CHIP_MATCH_BRIDGE && 2667 2667 (ops->vidioc_g_chip_info || p->match.addr == 0)) 2668 - return ops->vidioc_g_register(file, fh, p); 2668 + return ops->vidioc_g_register(file, NULL, p); 2669 2669 return -EINVAL; 2670 2670 #else 2671 2671 return -ENOTTY; ··· 2673 2673 } 2674 2674 2675 2675 static int v4l_dbg_s_register(const struct v4l2_ioctl_ops *ops, 2676 - struct file *file, void *fh, void *arg) 2676 + struct file *file, void *arg) 2677 2677 { 2678 2678 #ifdef CONFIG_VIDEO_ADV_DEBUG 2679 2679 const struct v4l2_dbg_register *p = arg; ··· 2693 2693 } 2694 2694 if (ops->vidioc_s_register && p->match.type == V4L2_CHIP_MATCH_BRIDGE && 2695 2695 (ops->vidioc_g_chip_info || p->match.addr == 0)) 2696 - return ops->vidioc_s_register(file, fh, p); 2696 + return ops->vidioc_s_register(file, NULL, p); 2697 2697 return -EINVAL; 2698 2698 #else 2699 2699 return -ENOTTY; ··· 2701 2701 } 2702 2702 2703 2703 static int v4l_dbg_g_chip_info(const struct v4l2_ioctl_ops *ops, 2704 - struct file *file, void *fh, void *arg) 2704 + struct file *file, void *arg) 2705 2705 { 2706 2706 #ifdef CONFIG_VIDEO_ADV_DEBUG 2707 2707 struct video_device *vfd = video_devdata(file); ··· 2717 2717 p->flags |= V4L2_CHIP_FL_READABLE; 2718 2718 strscpy(p->name, vfd->v4l2_dev->name, sizeof(p->name)); 2719 2719 if (ops->vidioc_g_chip_info) 2720 - return ops->vidioc_g_chip_info(file, fh, arg); 2720 + return ops->vidioc_g_chip_info(file, NULL, arg); 2721 2721 if (p->match.addr) 2722 2722 return -EINVAL; 2723 2723 return 0; ··· 2743 2743 #endif 2744 2744 } 2745 2745 2746 - static int v4l_dqevent(const struct v4l2_ioctl_ops *ops, 2747 - struct file *file, void *fh, void *arg) 2746 + static int v4l_dqevent(const struct v4l2_ioctl_ops *ops, struct file *file, 2747 + void *arg) 2748 2748 { 2749 2749 struct v4l2_fh *vfh = file_to_v4l2_fh(file); 2750 2750 ··· 2752 2752 } 2753 2753 2754 2754 static int v4l_subscribe_event(const struct v4l2_ioctl_ops *ops, 2755 - struct file *file, void *fh, void *arg) 2755 + struct file *file, void *arg) 2756 2756 { 2757 2757 struct v4l2_fh *vfh = file_to_v4l2_fh(file); 2758 2758 ··· 2760 2760 } 2761 2761 2762 2762 static int v4l_unsubscribe_event(const struct v4l2_ioctl_ops *ops, 2763 - struct file *file, void *fh, void *arg) 2763 + struct file *file, void *arg) 2764 2764 { 2765 2765 struct v4l2_fh *vfh = file_to_v4l2_fh(file); 2766 2766 ··· 2768 2768 } 2769 2769 2770 2770 static int v4l_g_sliced_vbi_cap(const struct v4l2_ioctl_ops *ops, 2771 - struct file *file, void *fh, void *arg) 2771 + struct file *file, void *arg) 2772 2772 { 2773 2773 struct v4l2_sliced_vbi_cap *p = arg; 2774 2774 int ret = check_fmt(file, p->type); ··· 2779 2779 /* Clear up to type, everything after type is zeroed already */ 2780 2780 memset(p, 0, offsetof(struct v4l2_sliced_vbi_cap, type)); 2781 2781 2782 - return ops->vidioc_g_sliced_vbi_cap(file, fh, p); 2782 + return ops->vidioc_g_sliced_vbi_cap(file, NULL, p); 2783 2783 } 2784 2784 2785 2785 static int v4l_enum_freq_bands(const struct v4l2_ioctl_ops *ops, 2786 - struct file *file, void *fh, void *arg) 2786 + struct file *file, void *arg) 2787 2787 { 2788 2788 struct video_device *vfd = video_devdata(file); 2789 2789 struct v4l2_frequency_band *p = arg; ··· 2801 2801 return -EINVAL; 2802 2802 } 2803 2803 if (ops->vidioc_enum_freq_bands) { 2804 - err = ops->vidioc_enum_freq_bands(file, fh, p); 2804 + err = ops->vidioc_enum_freq_bands(file, NULL, p); 2805 2805 if (err != -ENOTTY) 2806 2806 return err; 2807 2807 } ··· 2813 2813 2814 2814 if (p->index) 2815 2815 return -EINVAL; 2816 - err = ops->vidioc_g_tuner(file, fh, &t); 2816 + err = ops->vidioc_g_tuner(file, NULL, &t); 2817 2817 if (err) 2818 2818 return err; 2819 2819 p->capability = t.capability | V4L2_TUNER_CAP_FREQ_BANDS; ··· 2832 2832 return -EINVAL; 2833 2833 if (p->index) 2834 2834 return -EINVAL; 2835 - err = ops->vidioc_g_modulator(file, fh, &m); 2835 + err = ops->vidioc_g_modulator(file, NULL, &m); 2836 2836 if (err) 2837 2837 return err; 2838 2838 p->capability = m.capability | V4L2_TUNER_CAP_FREQ_BANDS; ··· 2849 2849 u32 flags; 2850 2850 const char * const name; 2851 2851 int (*func)(const struct v4l2_ioctl_ops *ops, struct file *file, 2852 - void *fh, void *p); 2852 + void *p); 2853 2853 void (*debug)(const void *arg, bool write_only); 2854 2854 }; 2855 2855 ··· 2870 2870 #define DEFINE_V4L_STUB_FUNC(_vidioc) \ 2871 2871 static int v4l_stub_ ## _vidioc( \ 2872 2872 const struct v4l2_ioctl_ops *ops, \ 2873 - struct file *file, void *fh, void *p) \ 2873 + struct file *file, void *p) \ 2874 2874 { \ 2875 - return ops->vidioc_ ## _vidioc(file, fh, p); \ 2875 + return ops->vidioc_ ## _vidioc(file, NULL, p); \ 2876 2876 } 2877 2877 2878 2878 #define IOCTL_INFO(_ioctl, _func, _debug, _flags) \ ··· 3126 3126 3127 3127 write_only = _IOC_DIR(cmd) == _IOC_WRITE; 3128 3128 if (info != &default_info) { 3129 - ret = info->func(ops, file, NULL, arg); 3129 + ret = info->func(ops, file, arg); 3130 3130 } else if (!ops->vidioc_default) { 3131 3131 ret = -ENOTTY; 3132 3132 } else {