summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJack Pham <jackp@codeaurora.org>2018-08-18 00:06:58 -0700
committerJack Pham <jackp@codeaurora.org>2018-08-21 00:54:08 -0700
commit4dabf448ae341dd492b45eb0f82fdd77ee5ef584 (patch)
treeac439674c4d8a8c07c16a494b9abc6e640fbaa01 /drivers
parent7454980b83c63405607d46ae462271a43aa9b57c (diff)
Revert "usb: phy: dual-role: update sysfs attrs when changed"
This reverts commit 563b2f7a6bed72d34560df5f4358e948eb52a43f. The previous approach of dynamically updating the writeable permission bits of the power/data_role attributes only works if the userspace application has root permission since the call to sysfs_update_group() removes and re-adds the files. If they had previously been chown/chgrp'ed, the ownership would be reset. On the other hand, if there was a ueventd rule to dynamically update the ownership, then the mode would always be overridden with the static umask given in the ueventd rule, contradicting the driver's determination of writeability. Hence, the more comprehensive fix should be done in userspace to not rely solely on writeability. Still, this change needs to be reverted since it can still cause a race between ueventd and the userspace service trying to check writability. Change-Id: Ic667a97f2bae41e5a86ee45565518b06db959b36 Signed-off-by: Jack Pham <jackp@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/phy/class-dual-role.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/usb/phy/class-dual-role.c b/drivers/usb/phy/class-dual-role.c
index 9ef889593ef5..51fcb545a9d5 100644
--- a/drivers/usb/phy/class-dual-role.c
+++ b/drivers/usb/phy/class-dual-role.c
@@ -70,7 +70,15 @@ static char *kstrdupcase(const char *str, gfp_t gfp, bool to_upper)
return ret;
}
-static void dual_role_changed_work(struct work_struct *work);
+static void dual_role_changed_work(struct work_struct *work)
+{
+ struct dual_role_phy_instance *dual_role =
+ container_of(work, struct dual_role_phy_instance,
+ changed_work);
+
+ dev_dbg(&dual_role->dev, "%s\n", __func__);
+ kobject_uevent(&dual_role->dev.kobj, KOBJ_CHANGE);
+}
void dual_role_instance_changed(struct dual_role_phy_instance *dual_role)
{
@@ -497,17 +505,6 @@ out:
return ret;
}
-static void dual_role_changed_work(struct work_struct *work)
-{
- struct dual_role_phy_instance *dual_role =
- container_of(work, struct dual_role_phy_instance,
- changed_work);
-
- dev_dbg(&dual_role->dev, "%s\n", __func__);
- sysfs_update_group(&dual_role->dev.kobj, &dual_role_attr_group);
- kobject_uevent(&dual_role->dev.kobj, KOBJ_CHANGE);
-}
-
/******************* Module Init ***********************************/
static int __init dual_role_class_init(void)