aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2016-04-03 16:44:17 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-04-20 15:09:31 -0400
commitfe29301122902a902c5c323ee14078b1ab3f1ad1 (patch)
treef93aa2a6b5b76342c39591905fb7b99349e229d9
parent96655553e5f9af6a8d908386685b7c865a138283 (diff)
[media] ivtv/cx18: use the new mask variants of the v4l2_device_call_* defines
Instead of rolling our own define, just use the new mask defines. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/pci/cx18/cx18-driver.h13
-rw-r--r--drivers/media/pci/ivtv/ivtv-driver.h13
2 files changed, 4 insertions, 22 deletions
diff --git a/drivers/media/pci/cx18/cx18-driver.h b/drivers/media/pci/cx18/cx18-driver.h
index 7e31f2a2e085..47ce80fa73b9 100644
--- a/drivers/media/pci/cx18/cx18-driver.h
+++ b/drivers/media/pci/cx18/cx18-driver.h
@@ -707,11 +707,7 @@ static inline int cx18_raw_vbi(const struct cx18 *cx)
707/* Call the specified callback for all subdevs with a grp_id bit matching the 707/* Call the specified callback for all subdevs with a grp_id bit matching the
708 * mask in hw (if 0, then match them all). Ignore any errors. */ 708 * mask in hw (if 0, then match them all). Ignore any errors. */
709#define cx18_call_hw(cx, hw, o, f, args...) \ 709#define cx18_call_hw(cx, hw, o, f, args...) \
710 do { \ 710 v4l2_device_mask_call_all(&(cx)->v4l2_dev, hw, o, f, ##args)
711 struct v4l2_subdev *__sd; \
712 __v4l2_device_call_subdevs_p(&(cx)->v4l2_dev, __sd, \
713 !(hw) || (__sd->grp_id & (hw)), o, f , ##args); \
714 } while (0)
715 711
716#define cx18_call_all(cx, o, f, args...) cx18_call_hw(cx, 0, o, f , ##args) 712#define cx18_call_all(cx, o, f, args...) cx18_call_hw(cx, 0, o, f , ##args)
717 713
@@ -719,12 +715,7 @@ static inline int cx18_raw_vbi(const struct cx18 *cx)
719 * mask in hw (if 0, then match them all). If the callback returns an error 715 * mask in hw (if 0, then match them all). If the callback returns an error
720 * other than 0 or -ENOIOCTLCMD, then return with that error code. */ 716 * other than 0 or -ENOIOCTLCMD, then return with that error code. */
721#define cx18_call_hw_err(cx, hw, o, f, args...) \ 717#define cx18_call_hw_err(cx, hw, o, f, args...) \
722({ \ 718 v4l2_device_mask_call_until_err(&(cx)->v4l2_dev, hw, o, f, ##args)
723 struct v4l2_subdev *__sd; \
724 __v4l2_device_call_subdevs_until_err_p(&(cx)->v4l2_dev, \
725 __sd, !(hw) || (__sd->grp_id & (hw)), o, f, \
726 ##args); \
727})
728 719
729#define cx18_call_all_err(cx, o, f, args...) \ 720#define cx18_call_all_err(cx, o, f, args...) \
730 cx18_call_hw_err(cx, 0, o, f , ##args) 721 cx18_call_hw_err(cx, 0, o, f , ##args)
diff --git a/drivers/media/pci/ivtv/ivtv-driver.h b/drivers/media/pci/ivtv/ivtv-driver.h
index 6c08dae67a73..10cba305dbd2 100644
--- a/drivers/media/pci/ivtv/ivtv-driver.h
+++ b/drivers/media/pci/ivtv/ivtv-driver.h
@@ -827,12 +827,7 @@ static inline int ivtv_raw_vbi(const struct ivtv *itv)
827/* Call the specified callback for all subdevs matching hw (if 0, then 827/* Call the specified callback for all subdevs matching hw (if 0, then
828 match them all). Ignore any errors. */ 828 match them all). Ignore any errors. */
829#define ivtv_call_hw(itv, hw, o, f, args...) \ 829#define ivtv_call_hw(itv, hw, o, f, args...) \
830 do { \ 830 v4l2_device_mask_call_all(&(itv)->v4l2_dev, hw, o, f, ##args)
831 struct v4l2_subdev *__sd; \
832 __v4l2_device_call_subdevs_p(&(itv)->v4l2_dev, __sd, \
833 !(hw) ? true : (__sd->grp_id & (hw)), \
834 o, f, ##args); \
835 } while (0)
836 831
837#define ivtv_call_all(itv, o, f, args...) ivtv_call_hw(itv, 0, o, f , ##args) 832#define ivtv_call_all(itv, o, f, args...) ivtv_call_hw(itv, 0, o, f , ##args)
838 833
@@ -840,11 +835,7 @@ static inline int ivtv_raw_vbi(const struct ivtv *itv)
840 match them all). If the callback returns an error other than 0 or 835 match them all). If the callback returns an error other than 0 or
841 -ENOIOCTLCMD, then return with that error code. */ 836 -ENOIOCTLCMD, then return with that error code. */
842#define ivtv_call_hw_err(itv, hw, o, f, args...) \ 837#define ivtv_call_hw_err(itv, hw, o, f, args...) \
843({ \ 838 v4l2_device_mask_call_until_err(&(itv)->v4l2_dev, hw, o, f, ##args)
844 struct v4l2_subdev *__sd; \
845 __v4l2_device_call_subdevs_until_err_p(&(itv)->v4l2_dev, __sd, \
846 !(hw) || (__sd->grp_id & (hw)), o, f , ##args); \
847})
848 839
849#define ivtv_call_all_err(itv, o, f, args...) ivtv_call_hw_err(itv, 0, o, f , ##args) 840#define ivtv_call_all_err(itv, o, f, args...) ivtv_call_hw_err(itv, 0, o, f , ##args)
850 841