From f5d3b35d7bd8cad3b01eefeb1e46252cd19c072f Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Sun, 1 Dec 2013 23:10:15 -0600 Subject: [PATCH] dahdi: Replace drv_attr with drv_groups on kernels > 3.12. drv_attrs was fully removed from the bus structure in upstream commit e18945b159a1cdbc031f1d3b0b7e515a33bdcbf7 which was merged into 3.13. This is necessary to compile dahdi against linux version 3.13. Signed-off-by: Shaun Ruffell --- drivers/dahdi/dahdi-sysfs.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/dahdi/dahdi-sysfs.c b/drivers/dahdi/dahdi-sysfs.c index 9583e63..322a496 100644 --- a/drivers/dahdi/dahdi-sysfs.c +++ b/drivers/dahdi/dahdi-sysfs.c @@ -251,19 +251,31 @@ static ssize_t master_span_store(struct device_driver *driver, const char *buf, return count; } - +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) static struct driver_attribute dahdi_attrs[] = { __ATTR(master_span, S_IRUGO | S_IWUSR, master_span_show, master_span_store), __ATTR_NULL, }; +#else +static DRIVER_ATTR_RW(master_span); +static struct attribute *dahdi_attrs[] = { + &driver_attr_master_span.attr, + NULL, +}; +ATTRIBUTE_GROUPS(dahdi); +#endif static struct bus_type spans_bus_type = { .name = "dahdi_spans", .match = span_match, .uevent = span_uevent, .dev_attrs = span_dev_attrs, +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) .drv_attrs = dahdi_attrs, +#else + .drv_groups = dahdi_groups, +#endif }; static int span_probe(struct device *dev)