diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-03-24 14:21:44 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-04-03 16:24:00 -0700 |
commit | 54bf08946a4ba0567f6ec063f0e42b276c478bcf (patch) | |
tree | 4b29e0ec364bb83c3001f3e3386084a429d3b997 /drivers/input/rmi4/rmi_spi.c | |
parent | 8a7c71ae38844948f1e42b3d85ab59868287e413 (diff) | |
download | blackbird-op-linux-54bf08946a4ba0567f6ec063f0e42b276c478bcf.tar.gz blackbird-op-linux-54bf08946a4ba0567f6ec063f0e42b276c478bcf.zip |
Input: synaptics-rmi4 - when registering sensors do not call them "drivers"
We are not registering drivers, but transport devices (AKA sensors), so
let's call them that.
Also let's rename "retval" to "error" in probe() functions as the variables
are used to store error codes.
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/rmi4/rmi_spi.c')
-rw-r--r-- | drivers/input/rmi4/rmi_spi.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/drivers/input/rmi4/rmi_spi.c b/drivers/input/rmi4/rmi_spi.c index 69548d7d1f10..d97a85907ed6 100644 --- a/drivers/input/rmi4/rmi_spi.c +++ b/drivers/input/rmi4/rmi_spi.c @@ -370,7 +370,7 @@ static int rmi_spi_probe(struct spi_device *spi) struct rmi_spi_xport *rmi_spi; struct rmi_device_platform_data *pdata; struct rmi_device_platform_data *spi_pdata = spi->dev.platform_data; - int retval; + int error; if (spi->master->flags & SPI_MASTER_HALF_DUPLEX) return -EINVAL; @@ -383,9 +383,9 @@ static int rmi_spi_probe(struct spi_device *spi) pdata = &rmi_spi->xport.pdata; if (spi->dev.of_node) { - retval = rmi_spi_of_probe(spi, pdata); - if (retval) - return retval; + error = rmi_spi_of_probe(spi, pdata); + if (error) + return error; } else if (spi_pdata) { *pdata = *spi_pdata; } @@ -396,10 +396,10 @@ static int rmi_spi_probe(struct spi_device *spi) if (pdata->spi_data.mode) spi->mode = pdata->spi_data.mode; - retval = spi_setup(spi); - if (retval < 0) { + error = spi_setup(spi); + if (error < 0) { dev_err(&spi->dev, "spi_setup failed!\n"); - return retval; + return error; } pdata->irq = spi->irq; @@ -413,32 +413,34 @@ static int rmi_spi_probe(struct spi_device *spi) spi_set_drvdata(spi, rmi_spi); - retval = rmi_spi_manage_pools(rmi_spi, RMI_SPI_DEFAULT_XFER_BUF_SIZE); - if (retval) - return retval; + error = rmi_spi_manage_pools(rmi_spi, RMI_SPI_DEFAULT_XFER_BUF_SIZE); + if (error) + return error; /* * Setting the page to zero will (a) make sure the PSR is in a * known state, and (b) make sure we can talk to the device. */ - retval = rmi_set_page(rmi_spi, 0); - if (retval) { + error = rmi_set_page(rmi_spi, 0); + if (error) { dev_err(&spi->dev, "Failed to set page select to 0.\n"); - return retval; + return error; } - retval = rmi_register_transport_device(&rmi_spi->xport); - if (retval) { - dev_err(&spi->dev, "failed to register transport.\n"); - return retval; + dev_info(&spi->dev, "registering SPI-connected sensor\n"); + + error = rmi_register_transport_device(&rmi_spi->xport); + if (error) { + dev_err(&spi->dev, "failed to register sensor: %d\n", error); + return error; } - retval = devm_add_action_or_reset(&spi->dev, + + error = devm_add_action_or_reset(&spi->dev, rmi_spi_unregister_transport, rmi_spi); - if (retval) - return retval; + if (error) + return error; - dev_info(&spi->dev, "registered RMI SPI driver\n"); return 0; } |