[PATCH] Input: synaptics-rmi4 - remove no-op reset handler

From: Matthias Schiffer
Date: Tue Nov 21 2023 - 05:37:21 EST


None of the individual function drivers have ever implemented a reset()
operation, meaning that reset_one_function() and in turn
rmi_driver_process_reset_requests() have always been no-ops. Get rid of
them.

Signed-off-by: Matthias Schiffer <matthias.schiffer@xxxxxxxxxxxxxxx>
---
drivers/input/rmi4/rmi_bus.h | 1 -
drivers/input/rmi4/rmi_driver.c | 38 ---------------------------------
2 files changed, 39 deletions(-)

diff --git a/drivers/input/rmi4/rmi_bus.h b/drivers/input/rmi4/rmi_bus.h
index 25df6320f9f1d..9b0860a8b06f9 100644
--- a/drivers/input/rmi4/rmi_bus.h
+++ b/drivers/input/rmi4/rmi_bus.h
@@ -80,7 +80,6 @@ struct rmi_function_handler {
int (*probe)(struct rmi_function *fn);
void (*remove)(struct rmi_function *fn);
int (*config)(struct rmi_function *fn);
- int (*reset)(struct rmi_function *fn);
irqreturn_t (*attention)(int irq, void *ctx);
int (*suspend)(struct rmi_function *fn);
int (*resume)(struct rmi_function *fn);
diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index 258d5fe3d395c..131add4b9affd 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -57,25 +57,6 @@ void rmi_free_function_list(struct rmi_device *rmi_dev)
data->f34_container = NULL;
}

-static int reset_one_function(struct rmi_function *fn)
-{
- struct rmi_function_handler *fh;
- int retval = 0;
-
- if (!fn || !fn->dev.driver)
- return 0;
-
- fh = to_rmi_function_handler(fn->dev.driver);
- if (fh->reset) {
- retval = fh->reset(fn);
- if (retval < 0)
- dev_err(&fn->dev, "Reset failed with code %d.\n",
- retval);
- }
-
- return retval;
-}
-
static int configure_one_function(struct rmi_function *fn)
{
struct rmi_function_handler *fh;
@@ -95,21 +76,6 @@ static int configure_one_function(struct rmi_function *fn)
return retval;
}

-static int rmi_driver_process_reset_requests(struct rmi_device *rmi_dev)
-{
- struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev);
- struct rmi_function *entry;
- int retval;
-
- list_for_each_entry(entry, &data->function_list, node) {
- retval = reset_one_function(entry);
- if (retval < 0)
- return retval;
- }
-
- return 0;
-}
-
static int rmi_driver_process_config_requests(struct rmi_device *rmi_dev)
{
struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev);
@@ -445,10 +411,6 @@ static int rmi_driver_reset_handler(struct rmi_device *rmi_dev)
return error;
}

- error = rmi_driver_process_reset_requests(rmi_dev);
- if (error < 0)
- return error;
-
error = rmi_driver_process_config_requests(rmi_dev);
if (error < 0)
return error;
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/