diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2013-10-26 00:40:13 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2013-10-26 12:09:44 +0200 |
commit | 79c4358ea2a095aa3b26539ca775cb697fc81a19 (patch) | |
tree | 8d4250ca63cd4a8f90b69982ff9f6d092053a611 | |
parent | 3738b70a5292d3bebfe93ff849eba9a8c9579164 (diff) |
backports: add resource_size()
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r-- | backport/backport-include/linux/ioport.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/backport/backport-include/linux/ioport.h b/backport/backport-include/linux/ioport.h index 34244014..b9aec4d6 100644 --- a/backport/backport-include/linux/ioport.h +++ b/backport/backport-include/linux/ioport.h @@ -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 */ |