Revert "(CR): haptic_hv: Prevent sysfs attrs from being destroyed"

Revert change as it breaks felix user builds.

This reverts commit b280c749286125393ff0b7d1961d04e6f4c71f49.

Change-Id: I03ec006d6451bd82c90a6f409fe897c362d95691
Reviewed-on: https://gerrit.mot.com/2448629
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Reviewed-by: Yinjun Chen <a7301c@motorola.com>
Submit-Approved: Yinjun Chen <a7301c@motorola.com>
Tested-by: Yinjun Chen <a7301c@motorola.com>
This commit is contained in:
Sridhar Vashist 2022-12-01 10:30:28 -06:00 • committed by Yinjun Chen
commit c304122037

View file

@ -3505,22 +3505,6 @@ static int vibrator_init(struct aw_haptic *aw_haptic)
aw_err("error creating sysfs attr files");
return ret;
}
/* Android has a habit of trying to set the vibrator trigger to "transient",
* which destroys our own "activate", "duration", and "state" attributes.
* Change the file permissions of the "trigger" attribute provided by
* leds_class to read-only so that no one can change the trigger of the
* vibrator LED device.
*
* Luckily, `sysfs_chmod_file` only uses the `name` field, so we can use a
* compound literal instead of having to find the proper attribute struct */
ret = sysfs_chmod_file(&aw_haptic->vib_dev.dev->kobj,
&((struct attribute){.name = "trigger"}),
S_IRUSR | S_IRGRP | S_IROTH);
if (ret < 0) {
aw_err("Unable to change trigger file permissions");
}
#endif
hrtimer_init(&aw_haptic->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
aw_haptic->timer.function = vibrator_timer_func;