[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190625112725.10154-3-fabian.krueger@fau.de>
Date: Tue, 25 Jun 2019 13:27:13 +0200
From: Fabian Krueger <fabian.krueger@....de>
To: unlisted-recipients:; (no To-header on input)
CC: <fabian.krueger@....de>,
Michael Scheiderer <michael.scheiderer@....de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
<devel@...verdev.osuosl.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH 2/8] 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@....de>
Signed-off-by: Michael Scheiderer <michael.scheiderer@....de>
---
drivers/staging/kpc2000/kpc2000_spi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c
index 7ed0fb6b4abb..e0e7703c6e53 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -203,6 +203,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)
@@ -214,6 +215,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)) {
@@ -445,6 +447,7 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m)
kp_spi_cleanup(struct spi_device *spidev)
{
struct kp_spi_controller_state *cs = spidev->controller_state;
+
if (cs) {
kfree(cs);
}
@@ -536,6 +539,7 @@ kp_spi_probe(struct platform_device *pldev)
kp_spi_remove(struct platform_device *pldev)
{
struct spi_master *master = platform_get_drvdata(pldev);
+
spi_unregister_master(master);
return 0;
}
--
2.17.1
Powered by blists - more mailing lists