summaryrefslogtreecommitdiffstats
path: root/drivers/input/rmi4/rmi_spi.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-10-30 06:12:50 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-10-30 06:12:50 +0100
commitfe0f59c41255d339f4f059be62c350c3c48a3f95 (patch)
treefde2381bf94a14ea1553f88f9e9e37b45ed280dc /drivers/input/rmi4/rmi_spi.c
parentcpufreq: intel_pstate: Always set max P-state in performance mode (diff)
parentDocumentation: intel_pstate: PID tuning is not always available (diff)
downloadlinux-fe0f59c41255d339f4f059be62c350c3c48a3f95.tar.xz
linux-fe0f59c41255d339f4f059be62c350c3c48a3f95.zip
Merge back earlier cpufreq material for v4.10.
Diffstat (limited to 'drivers/input/rmi4/rmi_spi.c')
-rw-r--r--drivers/input/rmi4/rmi_spi.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/input/rmi4/rmi_spi.c b/drivers/input/rmi4/rmi_spi.c
index 55bd1b34970c..4ebef607e214 100644
--- a/drivers/input/rmi4/rmi_spi.c
+++ b/drivers/input/rmi4/rmi_spi.c
@@ -396,6 +396,13 @@ static inline int rmi_spi_of_probe(struct spi_device *spi,
}
#endif
+static void rmi_spi_unregister_transport(void *data)
+{
+ struct rmi_spi_xport *rmi_spi = data;
+
+ rmi_unregister_transport_device(&rmi_spi->xport);
+}
+
static int rmi_spi_probe(struct spi_device *spi)
{
struct rmi_spi_xport *rmi_spi;
@@ -464,6 +471,11 @@ static int rmi_spi_probe(struct spi_device *spi)
dev_err(&spi->dev, "failed to register transport.\n");
return retval;
}
+ retval = devm_add_action_or_reset(&spi->dev,
+ rmi_spi_unregister_transport,
+ rmi_spi);
+ if (retval)
+ return retval;
retval = rmi_spi_init_irq(spi);
if (retval < 0)
@@ -473,15 +485,6 @@ static int rmi_spi_probe(struct spi_device *spi)
return 0;
}
-static int rmi_spi_remove(struct spi_device *spi)
-{
- struct rmi_spi_xport *rmi_spi = spi_get_drvdata(spi);
-
- rmi_unregister_transport_device(&rmi_spi->xport);
-
- return 0;
-}
-
#ifdef CONFIG_PM_SLEEP
static int rmi_spi_suspend(struct device *dev)
{
@@ -577,7 +580,6 @@ static struct spi_driver rmi_spi_driver = {
},
.id_table = rmi_id,
.probe = rmi_spi_probe,
- .remove = rmi_spi_remove,
};
module_spi_driver(rmi_spi_driver);