[PATCH 2/2] Input: regulator-haptic - fix coding style issues
From: Dmitry Torokhov
Date: Thu Nov 12 2026 - 01:58:17 EST
Fix minor coding style issues across the driver: add a comment
explaining mutex purpose, drop an unnecessary blank line after an open
brace, align function arguments with the open parenthesis, fix
whitespace in conditional checks, and use a space instead of a tab in
a return statement.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/input/misc/regulator-haptic.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/input/misc/regulator-haptic.c b/drivers/input/misc/regulator-haptic.c
index d99f716ef44b..4ede90195366 100644
--- a/drivers/input/misc/regulator-haptic.c
+++ b/drivers/input/misc/regulator-haptic.c
@@ -23,7 +23,7 @@ struct regulator_haptic {
struct regulator *regulator;
struct work_struct work;
- struct mutex mutex;
+ struct mutex mutex; /* serializes voltage updates and suspend/resume */
bool active;
bool suspended;
@@ -38,7 +38,6 @@ static int regulator_haptic_toggle(struct regulator_haptic *haptic, bool on)
int error;
if (haptic->active != on) {
-
error = on ? regulator_enable(haptic->regulator) :
regulator_disable(haptic->regulator);
if (error) {
@@ -55,7 +54,7 @@ static int regulator_haptic_toggle(struct regulator_haptic *haptic, bool on)
}
static int regulator_haptic_set_voltage(struct regulator_haptic *haptic,
- unsigned int magnitude)
+ unsigned int magnitude)
{
u64 volt_mag_multi;
unsigned int intensity;
@@ -118,7 +117,7 @@ static int regulator_haptic_parse_dt(struct device *dev,
int error;
node = dev->of_node;
- if(!node) {
+ if (!node) {
dev_err(dev, "Missing device tree data\n");
return -EINVAL;
}
@@ -165,7 +164,7 @@ static int regulator_haptic_probe(struct platform_device *pdev)
input_dev = devm_input_allocate_device(&pdev->dev);
if (!input_dev)
- return -ENOMEM;
+ return -ENOMEM;
haptic->input_dev = input_dev;
haptic->input_dev->name = "regulator-haptic";
--
2.56.0.567.gdb80ae8cd5-goog