[PATCH] i2c: at91: Use str_read_write() helper

long.yunjian at zte.com.cn long.yunjian at zte.com.cn
Thu May 22 23:16:47 PDT 2025


From: Yumeng Fang <fang.yumeng at zte.com.cn>

Remove hard-coded strings by using the str_read_write() helper.

Signed-off-by: Yumeng Fang <fang.yumeng at zte.com.cn>
Signed-off-by: Yunjian Long <long.yunjian at zte.com.cn>
---
 drivers/i2c/busses/i2c-at91-master.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-at91-master.c b/drivers/i2c/busses/i2c-at91-master.c
index ee3b469ddfb9..374fc50bb205 100644
--- a/drivers/i2c/busses/i2c-at91-master.c
+++ b/drivers/i2c/busses/i2c-at91-master.c
@@ -26,6 +26,7 @@
 #include <linux/pinctrl/consumer.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
+#include <linux/string_choices.h>

 #include "i2c-at91.h"

@@ -523,7 +524,7 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev)
 	 */

 	dev_dbg(dev->dev, "transfer: %s %zu bytes.\n",
-		(dev->msg->flags & I2C_M_RD) ? "read" : "write", dev->buf_len);
+		str_read_write(dev->msg->flags & I2C_M_RD), dev->buf_len);

 	reinit_completion(&dev->cmd_complete);
 	dev->transfer_status = 0;
-- 
2.25.1



More information about the linux-arm-kernel mailing list