Commit 17b7d785 authored by Yumeng Fang's avatar Yumeng Fang Committed by Wolfram Sang
Browse files

i2c: Use str_read_write() helper



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

Signed-off-by: default avatarYumeng Fang <fang.yumeng@zte.com.cn>
Signed-off-by: default avatarYunjian Long <long.yunjian@zte.com.cn>
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
parent 9c7dcf4c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <linux/errno.h>
#include <linux/i2c.h>
#include <linux/i2c-algo-pcf.h>
#include <linux/string_choices.h>
#include "i2c-algo-pcf.h"


@@ -316,7 +317,7 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap,
		pmsg = &msgs[i];

		DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: Doing %s %d bytes to 0x%02x - %d of %d messages\n",
		     pmsg->flags & I2C_M_RD ? "read" : "write",
		     str_read_write(pmsg->flags & I2C_M_RD),
		     pmsg->len, pmsg->addr, i + 1, num);)

		ret = pcf_doAddress(adap, pmsg);
+2 −1
Original line number Diff line number Diff line
@@ -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 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/string_choices.h>

/* Transmit operation:                                                      */
/*                                                                          */
@@ -409,7 +410,7 @@ static irqreturn_t sh_mobile_i2c_isr(int irq, void *dev_id)
	pd->sr |= sr; /* remember state */

	dev_dbg(pd->dev, "i2c_isr 0x%02x 0x%02x %s %d %d!\n", sr, pd->sr,
	       (pd->msg->flags & I2C_M_RD) ? "read" : "write",
	       str_read_write(pd->msg->flags & I2C_M_RD),
	       pd->pos, pd->msg->len);

	/* Kick off TxDMA after preface was done */
+2 −1
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/string_choices.h>
#include <linux/types.h>

/* include interfaces to usb layer */
@@ -71,7 +72,7 @@ static int usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num)

		dev_dbg(&adapter->dev,
			"  %d: %s (flags %d) %d bytes to 0x%02x\n",
			i, pmsg->flags & I2C_M_RD ? "read" : "write",
			i, str_read_write(pmsg->flags & I2C_M_RD),
			pmsg->flags, pmsg->len, pmsg->addr);

		/* and directly send the message */
+2 −1
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/string_choices.h>
#include <linux/types.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
@@ -278,7 +279,7 @@ static int vprbrd_i2c_xfer(struct i2c_adapter *i2c, struct i2c_msg *msgs,

		dev_dbg(&i2c->dev,
			"  %d: %s (flags %d) %d bytes to 0x%02x\n",
			i, pmsg->flags & I2C_M_RD ? "read" : "write",
			i, str_read_write(pmsg->flags & I2C_M_RD),
			pmsg->flags, pmsg->len, pmsg->addr);

		mutex_lock(&vb->lock);
Loading