diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2012-03-06 05:08:56 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-14 13:31:16 -0400 |
commit | 91f4eb0acb99a34e4b7fe9aee65ff9790be523c0 (patch) | |
tree | ebb0cec6a0f77014c91f1b5add7f811b83465e57 /drivers | |
parent | 2272ab657b508ece04bf015da6c23f61711bac81 (diff) |
[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')
-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 4b021e1ee5f2..0acc3d69b851 100644 --- a/drivers/media/video/m5mols/m5mols.h +++ b/drivers/media/video/m5mols/m5mols.h | |||
@@ -21,11 +21,6 @@ | |||
21 | 21 | ||
22 | extern int m5mols_debug; | 22 | extern int m5mols_debug; |
23 | 23 | ||
24 | #define to_m5mols(__sd) container_of(__sd, struct m5mols_info, sd) | ||
25 | |||
26 | #define to_sd(__ctrl) \ | ||
27 | (&container_of(__ctrl->handler, struct m5mols_info, handle)->sd) | ||
28 | |||
29 | enum m5mols_restype { | 24 | enum m5mols_restype { |
30 | M5MOLS_RESTYPE_MONITOR, | 25 | M5MOLS_RESTYPE_MONITOR, |
31 | M5MOLS_RESTYPE_CAPTURE, | 26 | M5MOLS_RESTYPE_CAPTURE, |
@@ -296,4 +291,16 @@ int m5mols_set_ctrl(struct v4l2_ctrl *ctrl); | |||
296 | int m5mols_update_fw(struct v4l2_subdev *sd, | 291 | int m5mols_update_fw(struct v4l2_subdev *sd, |
297 | int (*set_power)(struct m5mols_info *, bool)); | 292 | int (*set_power)(struct m5mols_info *, bool)); |
298 | 293 | ||
294 | static inline struct m5mols_info *to_m5mols(struct v4l2_subdev *subdev) | ||
295 | { | ||
296 | return container_of(subdev, struct m5mols_info, sd); | ||
297 | } | ||
298 | |||
299 | static inline struct v4l2_subdev *to_sd(struct v4l2_ctrl *ctrl) | ||
300 | { | ||
301 | struct m5mols_info *info = container_of(ctrl->handler, | ||
302 | struct m5mols_info, handle); | ||
303 | return &info->sd; | ||
304 | } | ||
305 | |||
299 | #endif /* M5MOLS_H */ | 306 | #endif /* M5MOLS_H */ |