Commit c030a41e authored by Feng Wei's avatar Feng Wei Committed by Andi Shyti
Browse files

i2c: mlxbf: Use str_read_write() helper



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

Signed-off-by: default avatarFeng Wei <feng.wei8@zte.com.cn>
Signed-off-by: default avatarShao Mingyin <shao.mingyin@zte.com.cn>
Link: https://lore.kernel.org/r/20250401192603311H5OxuFmUSbPc4VnQQkhZr@zte.com.cn


Signed-off-by: default avatarAndi Shyti <andi.shyti@kernel.org>
parent 8ae92c69
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/string.h>
#include <linux/string_choices.h>

/* Defines what functionality is present. */
#define MLXBF_I2C_FUNC_SMBUS_BLOCK \
@@ -2038,21 +2039,21 @@ static s32 mlxbf_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
					  read ? &data->byte : &command, read,
					  pec);
		dev_dbg(&adap->dev, "smbus %s byte, slave 0x%02x.\n",
			read ? "read" : "write", addr);
			str_read_write(read), addr);
		break;

	case I2C_SMBUS_BYTE_DATA:
		mlxbf_i2c_smbus_data_byte_func(&request, &command, &data->byte,
					       read, pec);
		dev_dbg(&adap->dev, "smbus %s byte data at 0x%02x, slave 0x%02x.\n",
			read ? "read" : "write", command, addr);
			str_read_write(read), command, addr);
		break;

	case I2C_SMBUS_WORD_DATA:
		mlxbf_i2c_smbus_data_word_func(&request, &command,
					       (u8 *)&data->word, read, pec);
		dev_dbg(&adap->dev, "smbus %s word data at 0x%02x, slave 0x%02x.\n",
			read ? "read" : "write", command, addr);
			str_read_write(read), command, addr);
		break;

	case I2C_SMBUS_I2C_BLOCK_DATA:
@@ -2060,7 +2061,7 @@ static s32 mlxbf_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
		mlxbf_i2c_smbus_i2c_block_func(&request, &command, data->block,
					       &byte_cnt, read, pec);
		dev_dbg(&adap->dev, "i2c %s block data, %d bytes at 0x%02x, slave 0x%02x.\n",
			read ? "read" : "write", byte_cnt, command, addr);
			str_read_write(read), byte_cnt, command, addr);
		break;

	case I2C_SMBUS_BLOCK_DATA:
@@ -2068,7 +2069,7 @@ static s32 mlxbf_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
		mlxbf_i2c_smbus_block_func(&request, &command, data->block,
					   &byte_cnt, read, pec);
		dev_dbg(&adap->dev, "smbus %s block data, %d bytes at 0x%02x, slave 0x%02x.\n",
			read ? "read" : "write", byte_cnt, command, addr);
			str_read_write(read), byte_cnt, command, addr);
		break;

	case I2C_FUNC_SMBUS_PROC_CALL: