Commit 91f4eb0a authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab

[media] m5mols: Convert macros to inline functions

Make to_sd and to_m5mols macros static inline functions
for better type safety.
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 2272ab65
......@@ -21,11 +21,6 @@
extern int m5mols_debug;
#define to_m5mols(__sd) container_of(__sd, struct m5mols_info, sd)
#define to_sd(__ctrl) \
(&container_of(__ctrl->handler, struct m5mols_info, handle)->sd)
enum m5mols_restype {
M5MOLS_RESTYPE_MONITOR,
M5MOLS_RESTYPE_CAPTURE,
......@@ -296,4 +291,16 @@ int m5mols_set_ctrl(struct v4l2_ctrl *ctrl);
int m5mols_update_fw(struct v4l2_subdev *sd,
int (*set_power)(struct m5mols_info *, bool));
static inline struct m5mols_info *to_m5mols(struct v4l2_subdev *subdev)
{
return container_of(subdev, struct m5mols_info, sd);
}
static inline struct v4l2_subdev *to_sd(struct v4l2_ctrl *ctrl)
{
struct m5mols_info *info = container_of(ctrl->handler,
struct m5mols_info, handle);
return &info->sd;
}
#endif /* M5MOLS_H */
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