[PATCH] logic_pio: change return type of ins() to void

Luo Qiu posted 1 patch 3 months, 1 week ago
drivers/bus/hisi_lpc.c    | 13 +++++--------
include/linux/logic_pio.h |  4 ++--
2 files changed, 7 insertions(+), 10 deletions(-)
[PATCH] logic_pio: change return type of ins() to void
Posted by Luo Qiu 3 months, 1 week ago
The ins operation in logic_pio_host_ops should return void instead of u32,
as it performs bulk input operations to a buffer and doesn't need to
return a value. This matches the semantics of the corresponding outs
operation and fixes a type inconsistency with logic_ins{bwl}.

Signed-off-by: Luo Qiu <luoqiu@kylinsec.com.cn>
---
 drivers/bus/hisi_lpc.c    | 13 +++++--------
 include/linux/logic_pio.h |  4 ++--
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c
index 53dd1573e323..a212fd39cf24 100644
--- a/drivers/bus/hisi_lpc.c
+++ b/drivers/bus/hisi_lpc.c
@@ -265,12 +265,9 @@ static void hisi_lpc_comm_out(void *hostdata, unsigned long pio,
  * @buffer: a buffer where read/input data bytes are stored
  * @dwidth: the data width required writing to the target I/O port
  * @count: how many data units whose length is dwidth will be read
- *
- * When success, the data read back is stored in buffer pointed by buffer.
- * Returns 0 on success, -errno otherwise.
  */
-static u32 hisi_lpc_comm_ins(void *hostdata, unsigned long pio, void *buffer,
-			     size_t dwidth, unsigned int count)
+static void hisi_lpc_comm_ins(void *hostdata, unsigned long pio, void *buffer,
+			      size_t dwidth, unsigned int count)
 {
 	struct hisi_lpc_dev *lpcdev = hostdata;
 	unsigned char *buf = buffer;
@@ -278,7 +275,7 @@ static u32 hisi_lpc_comm_ins(void *hostdata, unsigned long pio, void *buffer,
 	unsigned long addr;
 
 	if (!lpcdev || !buf || !count || !dwidth || dwidth > LPC_MAX_DWIDTH)
-		return -EINVAL;
+		return;
 
 	iopara.opflags = 0;
 	if (dwidth > 1)
@@ -292,11 +289,11 @@ static u32 hisi_lpc_comm_ins(void *hostdata, unsigned long pio, void *buffer,
 
 		ret = hisi_lpc_target_in(lpcdev, &iopara, addr, buf, dwidth);
 		if (ret)
-			return ret;
+			return;
 		buf += dwidth;
 	} while (--count);
 
-	return 0;
+	return;
 }
 
 /*
diff --git a/include/linux/logic_pio.h b/include/linux/logic_pio.h
index 8f1a9408302f..9f27d9374f71 100644
--- a/include/linux/logic_pio.h
+++ b/include/linux/logic_pio.h
@@ -31,8 +31,8 @@ struct logic_pio_host_ops {
 	u32 (*in)(void *hostdata, unsigned long addr, size_t dwidth);
 	void (*out)(void *hostdata, unsigned long addr, u32 val,
 		    size_t dwidth);
-	u32 (*ins)(void *hostdata, unsigned long addr, void *buffer,
-		   size_t dwidth, unsigned int count);
+	void (*ins)(void *hostdata, unsigned long addr, void *buffer,
+		    size_t dwidth, unsigned int count);
 	void (*outs)(void *hostdata, unsigned long addr, const void *buffer,
 		     size_t dwidth, unsigned int count);
 };
-- 
2.51.2