From c304122037ec2c0e33b21696eb73f232b3894a31 Mon Sep 17 00:00:00 2001 From: Sridhar Vashist Date: Thu, 1 Dec 2022 10:30:28 -0600 Subject: [PATCH] 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 Submit-Approved: Yinjun Chen Tested-by: Yinjun Chen --- drivers/misc/awinic/haptic_hv/haptic_hv.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/misc/awinic/haptic_hv/haptic_hv.c b/drivers/misc/awinic/haptic_hv/haptic_hv.c index ed1c69ddef92..9f8b20097969 100644 --- a/drivers/misc/awinic/haptic_hv/haptic_hv.c +++ b/drivers/misc/awinic/haptic_hv/haptic_hv.c @@ -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;