Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f0b8b95 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c: Do not use device name after device_unregister
  i2c/pca: Don't use *_interruptible
  i2c-ali1563: Remove sparse warnings
  i2c: Test off by one in {piix4,vt596}_transaction()
  i2c-core: Storage class should be before const qualifier
parents 330a518a c5567521
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -87,9 +87,9 @@ static int ali1563_transaction(struct i2c_adapter * a, int size)
	outb_p(inb_p(SMB_HST_CNTL2) | HST_CNTL2_START, SMB_HST_CNTL2);

	timeout = ALI1563_MAX_TIMEOUT;
	do
	do {
		msleep(1);
	while (((data = inb_p(SMB_HST_STS)) & HST_STS_BUSY) && --timeout);
	} while (((data = inb_p(SMB_HST_STS)) & HST_STS_BUSY) && --timeout);

	dev_dbg(&a->dev, "Transaction (post): STS=%02x, CNTL1=%02x, "
		"CNTL2=%02x, CMD=%02x, ADD=%02x, DAT0=%02x, DAT1=%02x\n",
@@ -157,9 +157,9 @@ static int ali1563_block_start(struct i2c_adapter * a)
	outb_p(inb_p(SMB_HST_CNTL2) | HST_CNTL2_START, SMB_HST_CNTL2);

	timeout = ALI1563_MAX_TIMEOUT;
	do
	do {
		msleep(1);
	while (!((data = inb_p(SMB_HST_STS)) & HST_STS_DONE) && --timeout);
	} while (!((data = inb_p(SMB_HST_STS)) & HST_STS_DONE) && --timeout);

	dev_dbg(&a->dev, "Block (post): STS=%02x, CNTL1=%02x, "
		"CNTL2=%02x, CMD=%02x, ADD=%02x, DAT0=%02x, DAT1=%02x\n",
+2 −2
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ static int pca_isa_waitforcompletion(void *pd)
	unsigned long timeout;

	if (irq > -1) {
		ret = wait_event_interruptible_timeout(pca_wait,
		ret = wait_event_timeout(pca_wait,
				pca_isa_readbyte(pd, I2C_PCA_CON)
				& I2C_PCA_CON_SI, pca_isa_ops.timeout);
	} else {
@@ -96,7 +96,7 @@ static void pca_isa_resetchip(void *pd)
}

static irqreturn_t pca_handler(int this_irq, void *dev_id) {
	wake_up_interruptible(&pca_wait);
	wake_up(&pca_wait);
	return IRQ_HANDLED;
}

+2 −2
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ static int i2c_pca_pf_waitforcompletion(void *pd)
	unsigned long timeout;

	if (i2c->irq) {
		ret = wait_event_interruptible_timeout(i2c->wait,
		ret = wait_event_timeout(i2c->wait,
			i2c->algo_data.read_byte(i2c, I2C_PCA_CON)
			& I2C_PCA_CON_SI, i2c->adap.timeout);
	} else {
@@ -122,7 +122,7 @@ static irqreturn_t i2c_pca_pf_handler(int this_irq, void *dev_id)
	if ((i2c->algo_data.read_byte(i2c, I2C_PCA_CON) & I2C_PCA_CON_SI) == 0)
		return IRQ_NONE;

	wake_up_interruptible(&i2c->wait);
	wake_up(&i2c->wait);

	return IRQ_HANDLED;
}
+2 −2
Original line number Diff line number Diff line
@@ -324,12 +324,12 @@ static int piix4_transaction(void)
	else
		msleep(1);

	while ((timeout++ < MAX_TIMEOUT) &&
	while ((++timeout < MAX_TIMEOUT) &&
	       ((temp = inb_p(SMBHSTSTS)) & 0x01))
		msleep(1);

	/* If the SMBus is still busy, we give up */
	if (timeout >= MAX_TIMEOUT) {
	if (timeout == MAX_TIMEOUT) {
		dev_err(&piix4_adapter.dev, "SMBus Timeout!\n");
		result = -ETIMEDOUT;
	}
+2 −2
Original line number Diff line number Diff line
@@ -165,10 +165,10 @@ static int vt596_transaction(u8 size)
	do {
		msleep(1);
		temp = inb_p(SMBHSTSTS);
	} while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT));
	} while ((temp & 0x01) && (++timeout < MAX_TIMEOUT));

	/* If the SMBus is still busy, we give up */
	if (timeout >= MAX_TIMEOUT) {
	if (timeout == MAX_TIMEOUT) {
		result = -ETIMEDOUT;
		dev_err(&vt596_adapter.dev, "SMBus timeout!\n");
	}
Loading