aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/extcon')
-rw-r--r--drivers/extcon/extcon-class.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/extcon/extcon-class.c b/drivers/extcon/extcon-class.c
index f6419f9db76c..481cfa0f2118 100644
--- a/drivers/extcon/extcon-class.c
+++ b/drivers/extcon/extcon-class.c
@@ -30,6 +30,7 @@
30#include <linux/err.h> 30#include <linux/err.h>
31#include <linux/extcon.h> 31#include <linux/extcon.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/sysfs.h>
33 34
34/* 35/*
35 * extcon_cable_name suggests the standard cable names for commonly used 36 * extcon_cable_name suggests the standard cable names for commonly used
@@ -673,10 +674,12 @@ int extcon_dev_register(struct extcon_dev *edev, struct device *dev)
673 cable->attr_g.name = str; 674 cable->attr_g.name = str;
674 cable->attr_g.attrs = cable->attrs; 675 cable->attr_g.attrs = cable->attrs;
675 676
677 sysfs_attr_init(&cable->attr_name.attr);
676 cable->attr_name.attr.name = "name"; 678 cable->attr_name.attr.name = "name";
677 cable->attr_name.attr.mode = 0444; 679 cable->attr_name.attr.mode = 0444;
678 cable->attr_name.show = cable_name_show; 680 cable->attr_name.show = cable_name_show;
679 681
682 sysfs_attr_init(&cable->attr_state.attr);
680 cable->attr_state.attr.name = "state"; 683 cable->attr_state.attr.name = "state";
681 cable->attr_state.attr.mode = 0644; 684 cable->attr_state.attr.mode = 0644;
682 cable->attr_state.show = cable_state_show; 685 cable->attr_state.show = cable_state_show;
@@ -722,6 +725,7 @@ int extcon_dev_register(struct extcon_dev *edev, struct device *dev)
722 goto err_muex; 725 goto err_muex;
723 } 726 }
724 strcpy(name, buf); 727 strcpy(name, buf);
728 sysfs_attr_init(&edev->d_attrs_muex[index].attr);
725 edev->d_attrs_muex[index].attr.name = name; 729 edev->d_attrs_muex[index].attr.name = name;
726 edev->d_attrs_muex[index].attr.mode = 0000; 730 edev->d_attrs_muex[index].attr.mode = 0000;
727 edev->attrs_muex[index] = &edev->d_attrs_muex[index] 731 edev->attrs_muex[index] = &edev->d_attrs_muex[index]