[PATCH 4/5] intel_mid_i2c: minor cleanups

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

 



uint32t -> u32
bracketing of case statements
spacing and '!' usage

Signed-off-by: Alan Cox <alan@xxxxxxxxxxxxxxx>
---

 drivers/i2c/busses/i2c-mrst.c |   54 +++++++++++++++++++----------------------
 1 files changed, 25 insertions(+), 29 deletions(-)


diff --git a/drivers/i2c/busses/i2c-mrst.c b/drivers/i2c/busses/i2c-mrst.c
index 9a8dfc8..974c189 100644
--- a/drivers/i2c/busses/i2c-mrst.c
+++ b/drivers/i2c/busses/i2c-mrst.c
@@ -240,50 +240,45 @@ static void mrst_i2c_abort(struct mrst_i2c_private *i2c)
 	 * the abort interrupt occured.
 	 */
 	switch (abort) {
-	case (ABRT_MASTER_DIS):
+	case ABRT_MASTER_DIS:
 		dev_err(&adap->dev,
-			"initiate Master operation with Master mode"
-			"disabled.\n");
+		"initiate Master operation with Master mode disabled.\n");
 
 		break;
-	case (ABRT_10B_RD_NORSTRT):
+	case ABRT_10B_RD_NORSTRT:
 		dev_err(&adap->dev,
-			"RESTART disabled and master sends READ cmd in 10-BIT"
-			"addressing.\n");
+	"RESTART disabled and master sends READ cmd in 10-BIT addressing.\n");
 		break;
-	case (ABRT_SBYTE_NORSTRT):
+	case ABRT_SBYTE_NORSTRT:
 		dev_err(&adap->dev,
-			"RESTART disabled and user is trying to send START"
-			"byte.\n");
+		"RESTART disabled and user is trying to send START byte.\n");
 		mrst_i2c_write(i2c->base + IC_TX_ABRT_SOURCE,
 			       !(ABRT_SBYTE_NORSTRT));
 		mrst_i2c_write(i2c->base + IC_CON, RESTART);
 		mrst_i2c_write(i2c->base + IC_TAR, !(IC_TAR_SPECIAL));
 		break;
-	case (ABRT_SBYTE_ACKDET):
+	case ABRT_SBYTE_ACKDET:
 		dev_err(&adap->dev,
 			"START byte was acknowledged.\n");
 		break;
-	case (ABRT_TXDATA_NOACK):
+	case ABRT_TXDATA_NOACK:
 		dev_err(&adap->dev,
 			"No acknowledge received from slave.\n");
 		break;
-	case (ABRT_10ADDR2_NOACK):
+	case ABRT_10ADDR2_NOACK:
 		dev_err(&adap->dev,
-			"The 2nd address byte of 10-bit address not"
-			"acknowledged.\n");
+	"The 2nd address byte of the 10-bit address not acknowledged.\n");
 		break;
-	case (ABRT_10ADDR1_NOACK):
+	case ABRT_10ADDR1_NOACK:
 		dev_dbg(&adap->dev,
-			"The 1st address byte of 10-bit address not"
-			"acknowledged.\n");
+		"The 1st address byte of 10-bit address not acknowledged.\n");
 		break;
-	case (ABRT_7B_ADDR_NOACK):
+	case ABRT_7B_ADDR_NOACK:
 		dev_err(&adap->dev,
 			"I2C slave device not acknowledge.\n");
 		break;
 	default:
-		;;
+		;
 	}
 
 	/* Clear TX_ABRT bit */
@@ -403,15 +398,15 @@ static int mrst_i2c_setup(struct i2c_adapter *adap,  struct i2c_msg *pmsg)
 	struct mrst_i2c_private *i2c =
 	    (struct mrst_i2c_private *)i2c_get_adapdata(adap);
 	int err;
-	uint32_t reg_val;
-	uint32_t bit_mask;
-	uint32_t mode;
+	u32 reg_val;
+	u32 bit_mask;
+	u32 mode;
 
 	/* Disable device first */
 	err = mrst_i2c_disable(adap);
 	if (err) {
 		dev_err(&adap->dev,
-			"Cannot disable i2c controller, timeout!\n");
+			"Cannot disable i2c controller, timeout\n");
 		return -ETIMEDOUT;
 	}
 
@@ -461,14 +456,15 @@ static int mrst_i2c_setup(struct i2c_adapter *adap,  struct i2c_msg *pmsg)
 	bit_mask = 1 << 11 | 1 << 10;
 
 	if ((reg_val & bit_mask) != 0x0) {
-		dev_dbg(&adap->dev, "WR: use target address when intiating"
-			"transfer, i2c_tx_target\n");
+		dev_dbg(&adap->dev,
+	 "WR: use target address when intiating transfer, i2c_tx_target\n");
 		mrst_i2c_write(i2c->base + IC_TAR, reg_val & ~bit_mask);
 	}
 
 	/* set target address to the I2C slave address */
-	dev_dbg(&adap->dev, "set target address to the I2C slave address,"
-		"addr is %x\n", pmsg->addr);
+	dev_dbg(&adap->dev,
+		"set target address to the I2C slave address, addr is %x\n",
+			pmsg->addr);
 	mrst_i2c_write(i2c->base + IC_TAR, pmsg->addr
 		       | (pmsg->flags & I2C_M_TEN ? IC_TAR_10BIT_ADDR : 0));
 
@@ -776,14 +772,14 @@ static int __devinit mrst_i2c_probe(struct pci_dev *dev,
 	/* Allocate the per-device data structure, mrst_i2c_private */
 	mrst = kzalloc(sizeof(struct mrst_i2c_private), GFP_KERNEL);
 	if (mrst == NULL) {
-		dev_err(&dev->dev, "Can't allocate interface!\n");
+		dev_err(&dev->dev, "Can't allocate interface\n");
 		err = -ENOMEM;
 		goto fail1;
 	}
 
 	adap = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL);
 	if (adap == NULL) {
-		dev_err(&dev->dev, "Can't allocate interface!\n");
+		dev_err(&dev->dev, "Can't allocate interface\n");
 		err = -ENOMEM;
 		goto fail2;
 	}

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


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux