Commit fe293011 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[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: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 96655553
...@@ -707,11 +707,7 @@ static inline int cx18_raw_vbi(const struct cx18 *cx) ...@@ -707,11 +707,7 @@ static inline int cx18_raw_vbi(const struct cx18 *cx)
/* Call the specified callback for all subdevs with a grp_id bit matching the /* Call the specified callback for all subdevs with a grp_id bit matching the
* mask in hw (if 0, then match them all). Ignore any errors. */ * mask in hw (if 0, then match them all). Ignore any errors. */
#define cx18_call_hw(cx, hw, o, f, args...) \ #define cx18_call_hw(cx, hw, o, f, args...) \
do { \ v4l2_device_mask_call_all(&(cx)->v4l2_dev, hw, o, f, ##args)
struct v4l2_subdev *__sd; \
__v4l2_device_call_subdevs_p(&(cx)->v4l2_dev, __sd, \
!(hw) || (__sd->grp_id & (hw)), o, f , ##args); \
} while (0)
#define cx18_call_all(cx, o, f, args...) cx18_call_hw(cx, 0, o, f , ##args) #define cx18_call_all(cx, o, f, args...) cx18_call_hw(cx, 0, o, f , ##args)
...@@ -719,12 +715,7 @@ static inline int cx18_raw_vbi(const struct cx18 *cx) ...@@ -719,12 +715,7 @@ static inline int cx18_raw_vbi(const struct cx18 *cx)
* mask in hw (if 0, then match them all). If the callback returns an error * mask in hw (if 0, then match them all). If the callback returns an error
* other than 0 or -ENOIOCTLCMD, then return with that error code. */ * other than 0 or -ENOIOCTLCMD, then return with that error code. */
#define cx18_call_hw_err(cx, hw, o, f, args...) \ #define cx18_call_hw_err(cx, hw, o, f, args...) \
({ \ v4l2_device_mask_call_until_err(&(cx)->v4l2_dev, hw, o, f, ##args)
struct v4l2_subdev *__sd; \
__v4l2_device_call_subdevs_until_err_p(&(cx)->v4l2_dev, \
__sd, !(hw) || (__sd->grp_id & (hw)), o, f, \
##args); \
})
#define cx18_call_all_err(cx, o, f, args...) \ #define cx18_call_all_err(cx, o, f, args...) \
cx18_call_hw_err(cx, 0, o, f , ##args) cx18_call_hw_err(cx, 0, o, f , ##args)
......
...@@ -827,12 +827,7 @@ static inline int ivtv_raw_vbi(const struct ivtv *itv) ...@@ -827,12 +827,7 @@ static inline int ivtv_raw_vbi(const struct ivtv *itv)
/* Call the specified callback for all subdevs matching hw (if 0, then /* Call the specified callback for all subdevs matching hw (if 0, then
match them all). Ignore any errors. */ match them all). Ignore any errors. */
#define ivtv_call_hw(itv, hw, o, f, args...) \ #define ivtv_call_hw(itv, hw, o, f, args...) \
do { \ v4l2_device_mask_call_all(&(itv)->v4l2_dev, hw, o, f, ##args)
struct v4l2_subdev *__sd; \
__v4l2_device_call_subdevs_p(&(itv)->v4l2_dev, __sd, \
!(hw) ? true : (__sd->grp_id & (hw)), \
o, f, ##args); \
} while (0)
#define ivtv_call_all(itv, o, f, args...) ivtv_call_hw(itv, 0, o, f , ##args) #define ivtv_call_all(itv, o, f, args...) ivtv_call_hw(itv, 0, o, f , ##args)
...@@ -840,11 +835,7 @@ static inline int ivtv_raw_vbi(const struct ivtv *itv) ...@@ -840,11 +835,7 @@ static inline int ivtv_raw_vbi(const struct ivtv *itv)
match them all). If the callback returns an error other than 0 or match them all). If the callback returns an error other than 0 or
-ENOIOCTLCMD, then return with that error code. */ -ENOIOCTLCMD, then return with that error code. */
#define ivtv_call_hw_err(itv, hw, o, f, args...) \ #define ivtv_call_hw_err(itv, hw, o, f, args...) \
({ \ v4l2_device_mask_call_until_err(&(itv)->v4l2_dev, hw, o, f, ##args)
struct v4l2_subdev *__sd; \
__v4l2_device_call_subdevs_until_err_p(&(itv)->v4l2_dev, __sd, \
!(hw) || (__sd->grp_id & (hw)), o, f , ##args); \
})
#define ivtv_call_all_err(itv, o, f, args...) ivtv_call_hw_err(itv, 0, o, f , ##args) #define ivtv_call_all_err(itv, o, f, args...) ivtv_call_hw_err(itv, 0, o, f , ##args)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment