aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMurali Karicheri2015-01-20 11:42:57 -0600
committerMurali Karicheri2015-01-22 09:50:12 -0600
commit03d441b8102abfd5c89d9a265538f498594484a9 (patch)
treef1058c20c5f3b9d93f40f2f56b86dca7ae985f3a
parentfe4b6c261ec1b69acecade5af7ab949d73d64a3f (diff)
downloadlinux-03d441b8102abfd5c89d9a265538f498594484a9.tar.gz
linux-03d441b8102abfd5c89d9a265538f498594484a9.tar.xz
linux-03d441b8102abfd5c89d9a265538f498594484a9.zip
net: keystone: ale: fix sysfs attribute issue when debug options are enabled
Currently when CONFIG_DEBUG_LOCKDEP is enabled, following errors are thrown by the kernel. "BUG: key ebc25d10 not in .data!" This patch fixes this issue by using sysfs_attr_init() to initialize the dynamically allocated attributes. Kernel otherwise expects this to be declared statically and passed to device_create_file(). Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
-rw-r--r--drivers/net/ethernet/ti/cpsw_ale.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
index 172c024631c..b0c4292ef90 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.c
+++ b/drivers/net/ethernet/ti/cpsw_ale.c
@@ -1570,14 +1570,17 @@ void cpsw_ale_start(struct cpsw_ale *ale)
1570 cpsw_ale_control_set(ale, i, ALE_PORT_STATE, ALE_PORT_STATE_DISABLE); 1570 cpsw_ale_control_set(ale, i, ALE_PORT_STATE, ALE_PORT_STATE_DISABLE);
1571 1571
1572 ale->ale_control_attr = dev_attr_ale_control; 1572 ale->ale_control_attr = dev_attr_ale_control;
1573 sysfs_attr_init(&ale->ale_control_attr.attr);
1573 ret = device_create_file(ale->params.dev, &ale->ale_control_attr); 1574 ret = device_create_file(ale->params.dev, &ale->ale_control_attr);
1574 WARN_ON(ret < 0); 1575 WARN_ON(ret < 0);
1575 1576
1576 ale->ale_table_attr = dev_attr_ale_table; 1577 ale->ale_table_attr = dev_attr_ale_table;
1578 sysfs_attr_init(&ale->ale_table_attr.attr);
1577 ret = device_create_file(ale->params.dev, &ale->ale_table_attr); 1579 ret = device_create_file(ale->params.dev, &ale->ale_table_attr);
1578 WARN_ON(ret < 0); 1580 WARN_ON(ret < 0);
1579 1581
1580 ale->ale_table_raw_attr = dev_attr_ale_table_raw; 1582 ale->ale_table_raw_attr = dev_attr_ale_table_raw;
1583 sysfs_attr_init(&ale->ale_table_raw_attr.attr);
1581 ret = device_create_file(ale->params.dev, &ale->ale_table_raw_attr); 1584 ret = device_create_file(ale->params.dev, &ale->ale_table_raw_attr);
1582 WARN_ON(ret < 0); 1585 WARN_ON(ret < 0);
1583 1586