diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2012-03-06 07:08:56 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-14 14:31:16 -0300 |
commit | 91f4eb0acb99a34e4b7fe9aee65ff9790be523c0 (patch) | |
tree | ebb0cec6a0f77014c91f1b5add7f811b83465e57 /drivers/media/video/m5mols | |
parent | 2272ab657b508ece04bf015da6c23f61711bac81 (diff) | |
download | op-kernel-dev-91f4eb0acb99a34e4b7fe9aee65ff9790be523c0.zip op-kernel-dev-91f4eb0acb99a34e4b7fe9aee65ff9790be523c0.tar.gz |
[media] m5mols: Convert macros to inline functions
Make to_sd and to_m5mols macros static inline functions
for better type safety.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/m5mols')
-rw-r--r-- | drivers/media/video/m5mols/m5mols.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/media/video/m5mols/m5mols.h b/drivers/media/video/m5mols/m5mols.h index 4b021e1..0acc3d6 100644 --- a/drivers/media/video/m5mols/m5mols.h +++ b/drivers/media/video/m5mols/m5mols.h @@ -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 */ |