[PATCH 1/2] Input: regulator-haptic - drop platform data support
From: Dmitry Torokhov
Date: Thu Nov 12 2026 - 01:54:38 EST
All users configure regulator-haptic devices via Device Tree, and there
are no in-tree board files providing platform data. Remove platform data
support, call regulator_haptic_parse_dt() directly from the probe
routine, and remove the unused header file.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/input/misc/regulator-haptic.c | 20 ++++----------
.../linux/platform_data/regulator-haptic.h | 26 -------------------
2 files changed, 5 insertions(+), 41 deletions(-)
delete mode 100644 include/linux/platform_data/regulator-haptic.h
diff --git a/drivers/input/misc/regulator-haptic.c b/drivers/input/misc/regulator-haptic.c
index b1aa3488ed6c..d99f716ef44b 100644
--- a/drivers/input/misc/regulator-haptic.c
+++ b/drivers/input/misc/regulator-haptic.c
@@ -10,7 +10,6 @@
#include <linux/input.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/platform_data/regulator-haptic.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
@@ -112,8 +111,8 @@ static void regulator_haptic_close(struct input_dev *input)
regulator_haptic_set_voltage(haptic, 0);
}
-static int __maybe_unused
-regulator_haptic_parse_dt(struct device *dev, struct regulator_haptic *haptic)
+static int regulator_haptic_parse_dt(struct device *dev,
+ struct regulator_haptic *haptic)
{
struct device_node *node;
int error;
@@ -141,7 +140,6 @@ regulator_haptic_parse_dt(struct device *dev, struct regulator_haptic *haptic)
static int regulator_haptic_probe(struct platform_device *pdev)
{
- const struct regulator_haptic_data *pdata = dev_get_platdata(&pdev->dev);
struct regulator_haptic *haptic;
struct input_dev *input_dev;
int error;
@@ -155,17 +153,9 @@ static int regulator_haptic_probe(struct platform_device *pdev)
mutex_init(&haptic->mutex);
INIT_WORK(&haptic->work, regulator_haptic_work);
- if (pdata) {
- haptic->max_volt = pdata->max_volt;
- haptic->min_volt = pdata->min_volt;
- } else if (IS_ENABLED(CONFIG_OF)) {
- error = regulator_haptic_parse_dt(&pdev->dev, haptic);
- if (error)
- return error;
- } else {
- dev_err(&pdev->dev, "Missing platform data\n");
- return -EINVAL;
- }
+ error = regulator_haptic_parse_dt(&pdev->dev, haptic);
+ if (error)
+ return error;
haptic->regulator = devm_regulator_get_exclusive(&pdev->dev, "haptic");
if (IS_ERR(haptic->regulator)) {
diff --git a/include/linux/platform_data/regulator-haptic.h b/include/linux/platform_data/regulator-haptic.h
deleted file mode 100644
index 4213e1b01316..000000000000
--- a/include/linux/platform_data/regulator-haptic.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Regulator Haptic Platform Data
- *
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- * Author: Jaewon Kim <jaewon02.kim@xxxxxxxxxxx>
- * Author: Hyunhee Kim <hyunhee.kim@xxxxxxxxxxx>
- */
-
-#ifndef _REGULATOR_HAPTIC_H
-#define _REGULATOR_HAPTIC_H
-
-/*
- * struct regulator_haptic_data - Platform device data
- *
- * @max_volt: maximum voltage value supplied to the haptic motor.
- * <The unit of the voltage is a micro>
- * @min_volt: minimum voltage value supplied to the haptic motor.
- * <The unit of the voltage is a micro>
- */
-struct regulator_haptic_data {
- unsigned int max_volt;
- unsigned int min_volt;
-};
-
-#endif /* _REGULATOR_HAPTIC_H */
--
2.56.0.567.gdb80ae8cd5-goog