compat: backport device_{lock,trylock,unlock}
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 7 Mar 2010 10:20:41 +0000 (11:20 +0100)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 8 Mar 2010 19:24:31 +0000 (11:24 -0800)
This fixes build of ar9170.

CC: Gus Wirth <gwirth79@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
include/linux/compat-2.6.34.h

index b5d1903..d189bee 100644 (file)
@@ -139,6 +139,22 @@ do {                                                               \
 #endif
 /* source: include/linux/netdevice.h */
 
+
+static inline void device_lock(struct device *dev)
+{
+       down(&dev->sem);
+}
+
+static inline int device_trylock(struct device *dev)
+{
+       return down_trylock(&dev->sem);
+}
+
+static inline void device_unlock(struct device *dev)
+{
+       up(&dev->sem);
+}
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)) */
 
 #endif /* LINUX_26_34_COMPAT_H */