Commit 524f3ac1 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: chipidea: convert platform driver to use dev_groups

Platform drivers now have the option to have the platform core create
and remove any needed sysfs attribute files.  So take advantage of that
and do not register "by hand" any sysfs files.

Cc: Peter Chen <Peter.Chen@nxp.com>
Link: https://lore.kernel.org/r/20190805193636.25560-1-gregkh@linuxfoundation.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3e2cb866
...@@ -903,10 +903,7 @@ static struct attribute *ci_attrs[] = { ...@@ -903,10 +903,7 @@ static struct attribute *ci_attrs[] = {
&dev_attr_role.attr, &dev_attr_role.attr,
NULL, NULL,
}; };
ATTRIBUTE_GROUPS(ci);
static const struct attribute_group ci_attr_group = {
.attrs = ci_attrs,
};
static int ci_hdrc_probe(struct platform_device *pdev) static int ci_hdrc_probe(struct platform_device *pdev)
{ {
...@@ -1105,14 +1102,8 @@ static int ci_hdrc_probe(struct platform_device *pdev) ...@@ -1105,14 +1102,8 @@ static int ci_hdrc_probe(struct platform_device *pdev)
device_set_wakeup_capable(&pdev->dev, true); device_set_wakeup_capable(&pdev->dev, true);
dbg_create_files(ci); dbg_create_files(ci);
ret = sysfs_create_group(&dev->kobj, &ci_attr_group);
if (ret)
goto remove_debug;
return 0; return 0;
remove_debug:
dbg_remove_files(ci);
stop: stop:
if (ci->is_otg && ci->roles[CI_ROLE_GADGET]) if (ci->is_otg && ci->roles[CI_ROLE_GADGET])
ci_hdrc_otg_destroy(ci); ci_hdrc_otg_destroy(ci);
...@@ -1139,7 +1130,6 @@ static int ci_hdrc_remove(struct platform_device *pdev) ...@@ -1139,7 +1130,6 @@ static int ci_hdrc_remove(struct platform_device *pdev)
} }
dbg_remove_files(ci); dbg_remove_files(ci);
sysfs_remove_group(&ci->dev->kobj, &ci_attr_group);
ci_role_destroy(ci); ci_role_destroy(ci);
ci_hdrc_enter_lpm(ci, true); ci_hdrc_enter_lpm(ci, true);
ci_usb_phy_exit(ci); ci_usb_phy_exit(ci);
...@@ -1318,6 +1308,7 @@ static struct platform_driver ci_hdrc_driver = { ...@@ -1318,6 +1308,7 @@ static struct platform_driver ci_hdrc_driver = {
.driver = { .driver = {
.name = "ci_hdrc", .name = "ci_hdrc",
.pm = &ci_pm_ops, .pm = &ci_pm_ops,
.dev_groups = ci_groups,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment