extcon: convert extcon_class to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups should be used instead. This converts the extcon_class code to use the correct field. Cc: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: Chanwoo Choi<cw00.choi@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
58b267d3e3
commit
af01da0e02
|
@ -148,6 +148,7 @@ static ssize_t state_store(struct device *dev, struct device_attribute *attr,
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
static DEVICE_ATTR_RW(state);
|
||||||
|
|
||||||
static ssize_t name_show(struct device *dev, struct device_attribute *attr,
|
static ssize_t name_show(struct device *dev, struct device_attribute *attr,
|
||||||
char *buf)
|
char *buf)
|
||||||
|
@ -163,6 +164,7 @@ static ssize_t name_show(struct device *dev, struct device_attribute *attr,
|
||||||
|
|
||||||
return sprintf(buf, "%s\n", dev_name(edev->dev));
|
return sprintf(buf, "%s\n", dev_name(edev->dev));
|
||||||
}
|
}
|
||||||
|
static DEVICE_ATTR_RO(name);
|
||||||
|
|
||||||
static ssize_t cable_name_show(struct device *dev,
|
static ssize_t cable_name_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
|
@ -527,11 +529,12 @@ int extcon_unregister_notifier(struct extcon_dev *edev,
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(extcon_unregister_notifier);
|
EXPORT_SYMBOL_GPL(extcon_unregister_notifier);
|
||||||
|
|
||||||
static struct device_attribute extcon_attrs[] = {
|
static struct attribute *extcon_attrs[] = {
|
||||||
__ATTR(state, S_IRUGO | S_IWUSR, state_show, state_store),
|
&dev_attr_state.attr,
|
||||||
__ATTR_RO(name),
|
&dev_attr_name.attr,
|
||||||
__ATTR_NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
ATTRIBUTE_GROUPS(extcon);
|
||||||
|
|
||||||
static int create_extcon_class(void)
|
static int create_extcon_class(void)
|
||||||
{
|
{
|
||||||
|
@ -539,7 +542,7 @@ static int create_extcon_class(void)
|
||||||
extcon_class = class_create(THIS_MODULE, "extcon");
|
extcon_class = class_create(THIS_MODULE, "extcon");
|
||||||
if (IS_ERR(extcon_class))
|
if (IS_ERR(extcon_class))
|
||||||
return PTR_ERR(extcon_class);
|
return PTR_ERR(extcon_class);
|
||||||
extcon_class->dev_attrs = extcon_attrs;
|
extcon_class->dev_groups = extcon_groups;
|
||||||
|
|
||||||
#if defined(CONFIG_ANDROID)
|
#if defined(CONFIG_ANDROID)
|
||||||
switch_class = class_compat_register("switch");
|
switch_class = class_compat_register("switch");
|
||||||
|
|
Loading…
Reference in New Issue