Commit 6d03c140 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: phy: fsl-usb: 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.
Acked-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
Link: https://lore.kernel.org/r/20190815125903.GA17065@kroah.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b98052e9
...@@ -1043,6 +1043,11 @@ static ssize_t show_fsl_usb2_otg_state(struct device *dev, ...@@ -1043,6 +1043,11 @@ static ssize_t show_fsl_usb2_otg_state(struct device *dev,
static DEVICE_ATTR(fsl_usb2_otg_state, S_IRUGO, show_fsl_usb2_otg_state, NULL); static DEVICE_ATTR(fsl_usb2_otg_state, S_IRUGO, show_fsl_usb2_otg_state, NULL);
static struct attribute *fsl_otg_attrs[] = {
&dev_attr_fsl_usb2_otg_state.attr,
NULL,
};
ATTRIBUTE_GROUPS(fsl_otg);
/* Char driver interface to control some OTG input */ /* Char driver interface to control some OTG input */
...@@ -1132,10 +1137,6 @@ static int fsl_otg_probe(struct platform_device *pdev) ...@@ -1132,10 +1137,6 @@ static int fsl_otg_probe(struct platform_device *pdev)
return ret; return ret;
} }
ret = device_create_file(&pdev->dev, &dev_attr_fsl_usb2_otg_state);
if (ret)
dev_warn(&pdev->dev, "Can't register sysfs attribute\n");
return ret; return ret;
} }
...@@ -1152,8 +1153,6 @@ static int fsl_otg_remove(struct platform_device *pdev) ...@@ -1152,8 +1153,6 @@ static int fsl_otg_remove(struct platform_device *pdev)
kfree(fsl_otg_dev->phy.otg); kfree(fsl_otg_dev->phy.otg);
kfree(fsl_otg_dev); kfree(fsl_otg_dev);
device_remove_file(&pdev->dev, &dev_attr_fsl_usb2_otg_state);
unregister_chrdev(FSL_OTG_MAJOR, FSL_OTG_NAME); unregister_chrdev(FSL_OTG_MAJOR, FSL_OTG_NAME);
if (pdata->exit) if (pdata->exit)
...@@ -1168,6 +1167,7 @@ struct platform_driver fsl_otg_driver = { ...@@ -1168,6 +1167,7 @@ struct platform_driver fsl_otg_driver = {
.driver = { .driver = {
.name = driver_name, .name = driver_name,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.dev_groups = fsl_otg_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