[PATCH 2/2] I2C: ISP1301: Define better names for state_name and state_string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Felipe Balbi <felipe.lima@xxxxxxxxxxx>

Like musb driver, we're using otg_state_string instead of
state_string. Same for state_name.

Signed-off-by: Felipe Balbi <felipe.lima@xxxxxxxxxxx>
---
 drivers/i2c/chips/isp1301_omap.c |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/i2c/chips/isp1301_omap.c b/drivers/i2c/chips/isp1301_omap.c
index 4562335..090a614 100644
--- a/drivers/i2c/chips/isp1301_omap.c
+++ b/drivers/i2c/chips/isp1301_omap.c
@@ -233,7 +233,7 @@ isp1301_clear_bits(struct isp1301 *isp, u8 reg, u8 bits)
 
 /*-------------------------------------------------------------------------*/
 
-static const char *state_string(enum usb_otg_state state)
+static const char *otg_state_string(enum usb_otg_state state)
 {
 	switch (state) {
 	case OTG_STATE_A_IDLE:		return "a_idle";
@@ -253,9 +253,9 @@ static const char *state_string(enum usb_otg_state state)
 	}
 }
 
-static inline const char *state_name(struct isp1301 *isp)
+static inline const char *otg_state_name(struct isp1301 *isp)
 {
-	return state_string(isp->otg.state);
+	return otg_state_string(isp->otg.state);
 }
 
 #ifdef	VERBOSE
@@ -379,7 +379,7 @@ static void a_idle(struct isp1301 *isp, const char *tag)
 	}
 	isp->otg.state = OTG_STATE_A_IDLE;
 	isp->last_otg_ctrl = OTG_CTRL_REG = OTG_CTRL_REG & OTG_XCEIV_OUTPUTS;
-	pr_debug("  --> %s/%s\n", state_name(isp), tag);
+	pr_debug("  --> %s/%s\n", otg_state_name(isp), tag);
 }
 
 /* called from irq handlers */
@@ -399,7 +399,7 @@ static void b_idle(struct isp1301 *isp, const char *tag)
 	}
 	isp->otg.state = OTG_STATE_B_IDLE;
 	isp->last_otg_ctrl = OTG_CTRL_REG = OTG_CTRL_REG & OTG_XCEIV_OUTPUTS;
-	pr_debug("  --> %s/%s\n", state_name(isp), tag);
+	pr_debug("  --> %s/%s\n", otg_state_name(isp), tag);
 }
 
 static void
@@ -411,7 +411,7 @@ dump_regs(struct isp1301 *isp, const char *label)
 	u8	src = isp1301_get_u8(isp, ISP1301_INTERRUPT_SOURCE);
 
 	pr_debug("otg: %06x, %s %s, otg/%02x stat/%02x.%02x\n",
-		OTG_CTRL_REG, label, state_name(isp),
+		OTG_CTRL_REG, label, otg_state_name(isp),
 		ctrl, status, src);
 	/* mode control and irq enables don't change much */
 #endif
@@ -499,7 +499,7 @@ static void check_state(struct isp1301 *isp, const char *tag)
 	if (isp->otg.state == state && !extra)
 		return;
 	pr_debug("otg: %s FSM %s/%02x, %s, %06x\n", tag,
-		state_string(state), fsm, state_name(isp), OTG_CTRL_REG);
+		otg_state_string(state), fsm, otg_state_name(isp), OTG_CTRL_REG);
 }
 
 #else
@@ -702,7 +702,7 @@ static irqreturn_t omap_otg_irq(int irq, void *_isp)
 	/* HNP to become b_host failed */
 	} else if (otg_irq & B_HNP_FAIL) {
 		pr_debug("otg: %s B_HNP_FAIL, %06x\n",
-				state_name(isp), OTG_CTRL_REG);
+				otg_state_name(isp), OTG_CTRL_REG);
 		notresponding(isp);
 
 		otg_ctrl = OTG_CTRL_REG;
@@ -720,7 +720,7 @@ static irqreturn_t omap_otg_irq(int irq, void *_isp)
 	/* detect SRP from B-device ... */
 	} else if (otg_irq & A_SRP_DETECT) {
 		pr_debug("otg: %s SRP_DETECT, %06x\n",
-				state_name(isp), OTG_CTRL_REG);
+				otg_state_name(isp), OTG_CTRL_REG);
 
 		isp1301_defer_work(isp, WORK_UPDATE_OTG);
 		switch (isp->otg.state) {
@@ -748,7 +748,7 @@ static irqreturn_t omap_otg_irq(int irq, void *_isp)
 	} else if (otg_irq & A_REQ_TMROUT) {
 		otg_ctrl = OTG_CTRL_REG;
 		pr_info("otg: BCON_TMOUT from %s, %06x\n",
-				state_name(isp), otg_ctrl);
+				otg_state_name(isp), otg_ctrl);
 		notresponding(isp);
 
 		otg_ctrl |= OTG_BUSDROP;
@@ -763,7 +763,7 @@ static irqreturn_t omap_otg_irq(int irq, void *_isp)
 	} else if (otg_irq & A_VBUS_ERR) {
 		otg_ctrl = OTG_CTRL_REG;
 		printk(KERN_ERR "otg: %s, VBUS_ERR %04x ctrl %06x\n",
-			state_name(isp), otg_irq, otg_ctrl);
+			otg_state_name(isp), otg_irq, otg_ctrl);
 
 		otg_ctrl |= OTG_BUSDROP;
 		otg_ctrl &= ~OTG_A_BUSREQ & OTG_CTRL_MASK & ~OTG_XCEIV_INPUTS;
@@ -781,7 +781,7 @@ static irqreturn_t omap_otg_irq(int irq, void *_isp)
 
 		otg_ctrl = OTG_CTRL_REG;
 		printk(KERN_NOTICE "otg: %s, SWITCH to %s, ctrl %06x\n",
-				state_name(isp),
+				otg_state_name(isp),
 				(otg_ctrl & OTG_DRIVER_SEL)
 					? "gadget" : "host",
 				otg_ctrl);
@@ -864,7 +864,7 @@ static int otg_init(struct isp1301 *isp)
 
 	check_state(isp, __FUNCTION__);
 	pr_debug("otg: %s, %s %06x\n",
-			state_name(isp), __FUNCTION__, OTG_CTRL_REG);
+			otg_state_name(isp), __FUNCTION__, OTG_CTRL_REG);
 
 	OTG_IRQ_EN_REG = DRIVER_SWITCH | OPRT_CHG
 			| B_SRP_TMROUT | B_HNP_FAIL
@@ -959,7 +959,7 @@ static void isp_update_otg(struct isp1301 *isp, u8 stat)
 	enum usb_otg_state	state = isp->otg.state;
 
 	if (stat & INTR_BDIS_ACON)
-		pr_debug("OTG:  BDIS_ACON, %s\n", state_name(isp));
+		pr_debug("OTG:  BDIS_ACON, %s\n", otg_state_name(isp));
 
 	/* start certain state transitions right away */
 	isp_stat = isp1301_get_u8(isp, ISP1301_INTERRUPT_SOURCE);
@@ -1071,14 +1071,14 @@ static void isp_update_otg(struct isp1301 *isp, u8 stat)
 			break;
 		default:
 			pr_debug("otg: unsupported b-device %s\n",
-				state_name(isp));
+				otg_state_name(isp));
 			break;
 		}
 	}
 
 	if (state != isp->otg.state)
 		pr_debug("  isp, %s -> %s\n",
-				state_string(state), state_name(isp));
+				otg_state_string(state), otg_state_name(isp));
 
 #ifdef	CONFIG_USB_OTG
 	/* update the OTG controller state to match the isp1301; may
@@ -1155,7 +1155,7 @@ isp1301_work(struct work_struct *work)
 				break;
 			default:
 				pr_debug("  host resume in %s\n",
-						state_name(isp));
+						otg_state_name(isp));
 			}
 			host_resume(isp);
 			/* mdelay(10); */
@@ -1420,7 +1420,7 @@ isp1301_start_srp(struct otg_transceiver *dev)
 	OTG_CTRL_REG = otg_ctrl;
 	isp->otg.state = OTG_STATE_B_SRP_INIT;
 
-	pr_debug("otg: SRP, %s ... %06x\n", state_name(isp), OTG_CTRL_REG);
+	pr_debug("otg: SRP, %s ... %06x\n", otg_state_name(isp), OTG_CTRL_REG);
 #ifdef	CONFIG_USB_OTG
 	check_state(isp, __FUNCTION__);
 #endif
@@ -1472,7 +1472,7 @@ isp1301_start_hnp(struct otg_transceiver *dev)
 		return -EILSEQ;
 	}
 	pr_debug("otg: HNP %s, %06x ...\n",
-		state_name(isp), OTG_CTRL_REG);
+		otg_state_name(isp), OTG_CTRL_REG);
 	check_state(isp, __FUNCTION__);
 	return 0;
 #else
-- 
1.5.3.7.1157.gbf82a

-
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux