backports: add resource_size()
authorHauke Mehrtens <hauke@hauke-m.de>
Fri, 25 Oct 2013 22:40:13 +0000 (00:40 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 26 Oct 2013 10:09:44 +0000 (12:09 +0200)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
backport/backport-include/linux/ioport.h

index 342440149c28ce120dcf9117531dad430e38a705..b9aec4d694947dd457e2279cfcb20aff4cf74501 100644 (file)
@@ -6,4 +6,11 @@
 #define IORESOURCE_REG         0x00000300
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+static inline resource_size_t resource_size(const struct resource *res)
+{
+       return res->end - res->start + 1;
+}
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) */
+
 #endif /* __BACKPORT_LINUX_IOPORT_H */