diff options
author | Fabian Krueger <fabian.krueger@fau.de> | 2019-06-26 09:35:20 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-07-01 09:19:27 +0200 |
commit | c70c7284a058b0c1855d945027d0bb39acd21f5d (patch) | |
tree | aa0df739ba59eb67b2a5957342799bf3a6173d1b | |
parent | 06ed6146d6c1f647c40f24c195f8959687e3876b (diff) | |
download | linux-c70c7284a058b0c1855d945027d0bb39acd21f5d.tar.bz2 |
staging: kpc2000: blank lines after declaration
After the declarations in a function, there should be a blank line, so
that the declaration part is visibly separated from the rest.
This refactoring makes the code more readable.
Signed-off-by: Fabian Krueger <fabian.krueger@fau.de>
Signed-off-by: Michael Scheiderer <michael.scheiderer@fau.de>
Cc: <linux-kernel@i4.cs.fau.de>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/kpc2000/kpc2000_spi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index 6812d27764e2..30073440189e 100644 --- a/drivers/staging/kpc2000/kpc2000_spi.c +++ b/drivers/staging/kpc2000/kpc2000_spi.c @@ -176,6 +176,7 @@ kp_spi_read_reg(struct kp_spi_controller_state *cs, int idx) kp_spi_write_reg(struct kp_spi_controller_state *cs, int idx, u64 val) { u64 __iomem *addr = cs->base; + addr += idx; writeq(val, addr); if (idx == KP_SPI_REG_CONFIG) @@ -187,6 +188,7 @@ kp_spi_wait_for_reg_bit(struct kp_spi_controller_state *cs, int idx, unsigned long bit) { unsigned long timeout; + timeout = jiffies + msecs_to_jiffies(1000); while (!(kp_spi_read_reg(cs, idx) & bit)) { if (time_after(jiffies, timeout)) { @@ -416,6 +418,7 @@ error: kp_spi_cleanup(struct spi_device *spidev) { struct kp_spi_controller_state *cs = spidev->controller_state; + if (cs) { kfree(cs); } @@ -507,6 +510,7 @@ free_master: kp_spi_remove(struct platform_device *pldev) { struct spi_master *master = platform_get_drvdata(pldev); + spi_unregister_master(master); return 0; } |