From 89a058fe300d70e374ff0501429c48ec10c7b840 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Tue, 19 May 2009 14:12:15 +0000 Subject: Replaece member bus_id with dev_name() and set_dev_name() As of 2.6.26 the macros dev_name() and set_dev_name() are used to read and set (respectively) the bus_id member in sysfs. As of 2.6.30 bus_id is gone. This patch provides comaptiobility macros for older kernel versions and removes direct usage of bus_id. (closes issue #14965) Patches: xpp_2630_dev_name.diff uploaded by tzafrir (license 46) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6637 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/xpp/xdefs.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/dahdi/xpp/xdefs.h') diff --git a/drivers/dahdi/xpp/xdefs.h b/drivers/dahdi/xpp/xdefs.h index 4bdcf8a..1a25e68 100644 --- a/drivers/dahdi/xpp/xdefs.h +++ b/drivers/dahdi/xpp/xdefs.h @@ -136,6 +136,12 @@ typedef unsigned char byte; ssize_t name(struct device *dev, const char *buf, size_t count) #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26) +#define dev_name(dev) (dev)->bus_id +#define dev_set_name(dev, format, ...) \ + snprintf((dev)->bus_id, BUS_ID_SIZE, format, ## __VA_ARGS__); +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) /* Also don't define this for later RHEL >= 5.2 . hex_asc is from the * same linux-2.6-net-infrastructure-updates-to-mac80211-iwl4965.patch -- cgit v1.2.3