diff options
Diffstat (limited to 'v4l/compat.h')
-rw-r--r-- | v4l/compat.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/v4l/compat.h b/v4l/compat.h index ce28da615..11dc57109 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -9,7 +9,7 @@ * non-delayed work and struct delayed_work was created for delayed work. This * will rename the structures. Hopefully no one will decide to name something * delayed_work in the same context as something named work_struct. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +#ifdef NEED_DELAYED_WORK #define delayed_work work_struct #define INIT_DELAYED_WORK(a,b,c) INIT_WORK(a,b,c) #endif @@ -146,6 +146,12 @@ do { \ ((dev->bus && 0 == strcmp(dev->bus->name, "i2c")) ? to_i2c_client(dev) : NULL) #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) +/* Construct an I2C_CLIENT_END-terminated array of i2c addresses */ +#define I2C_ADDRS(addr, addrs...) \ + ((const unsigned short []){ addr, ## addrs, I2C_CLIENT_END }) +#endif + #ifndef USB_DEVICE_AND_INTERFACE_INFO # define USB_DEVICE_AND_INTERFACE_INFO(vend,prod,cl,sc,pr) \ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \ @@ -283,10 +289,14 @@ static inline int dummy_algo_control(struct i2c_adapter *adapter, }) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) +#ifdef NEED_SND_BUG_ON #define snd_BUG_ON(cond) WARN((cond), "BUG? (%s)\n", __stringify(cond)) #endif +#ifdef NEED_BITOPS +#define BIT(x) (1UL<<((x)%BITS_PER_LONG)) +#endif + #ifndef PCI_DEVICE_ID_MARVELL_88ALP01_CCIC #define PCI_DEVICE_ID_MARVELL_88ALP01_CCIC 0x4102 #endif @@ -462,6 +472,7 @@ static inline int snd_card_create(int idx, const char *id, defined(__x86_64__) || \ (BITS_PER_LONG == 64 && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))) /* This define will prevent breakage if __fls was already defined. */ +#undef __fls #define __fls v4l_compat_fls static inline unsigned long v4l_compat_fls(unsigned long x) { |