From: Greg Hackmann Date: Fri, 11 Oct 2013 20:54:41 +0000 (-0700) Subject: staging: sw_sync: add stubs for kernels without CONFIG_SW_SYNC X-Git-Tag: firefly_0821_release~4090^2~489^2~10 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3eeae661f1c26431dd03d2760e2373620bb488ca;p=firefly-linux-kernel-4.4.55.git staging: sw_sync: add stubs for kernels without CONFIG_SW_SYNC Change-Id: I7a12679eb3c10b1beaf36c6612cf2e3f6662a034 Signed-off-by: Greg Hackmann --- diff --git a/drivers/staging/android/sw_sync.h b/drivers/staging/android/sw_sync.h index 585040be5f18..aba25cbb0382 100644 --- a/drivers/staging/android/sw_sync.h +++ b/drivers/staging/android/sw_sync.h @@ -21,6 +21,7 @@ #ifdef __KERNEL__ +#include #include "sync.h" struct sw_sync_timeline { @@ -35,10 +36,27 @@ struct sw_sync_pt { u32 value; }; +#if IS_ENABLED(CONFIG_SW_SYNC) struct sw_sync_timeline *sw_sync_timeline_create(const char *name); void sw_sync_timeline_inc(struct sw_sync_timeline *obj, u32 inc); struct sync_pt *sw_sync_pt_create(struct sw_sync_timeline *obj, u32 value); +#else +static inline struct sw_sync_timeline *sw_sync_timeline_create(const char *name) +{ + return NULL; +} + +static inline void sw_sync_timeline_inc(struct sw_sync_timeline *obj, u32 inc) +{ +} + +static inline struct sync_pt *sw_sync_pt_create(struct sw_sync_timeline *obj, + u32 value) +{ + return NULL; +} +#endif /* IS_ENABLED(CONFIG_SW_SYNC) */ #endif /* __KERNEL __ */