From: greg@kroah.com (Greg KH)
To: linux-kernel@vger.kernel.org, sensors@stimpy.netroedge.com
Subject: [PATCH] i2c driver fixes for 2.6.4
Date: Thu, 19 May 2005 06:24:47 +0000 [thread overview]
Message-ID: <10793913932709@kroah.com> (raw)
In-Reply-To: <10793913932371@kroah.com>
In-Reply-To: <10793913903814@kroah.com>
ChangeSet 1.1597.1.11, 2004/03/03 10:07:50-08:00, dave.jiang@intel.com
[PATCH] I2C: IOP3xx i2c driver update
Here's a small patch update to the i2c-iop3xx.c in
drivers/i2c/busses/. It fixes some functions' return value and updated
the irq handler to be compatible with kernel 2.6. Thanks!
drivers/i2c/busses/i2c-iop3xx.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff -Nru a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
--- a/drivers/i2c/busses/i2c-iop3xx.c Mon Mar 15 14:35:39 2004
+++ b/drivers/i2c/busses/i2c-iop3xx.c Mon Mar 15 14:35:39 2004
@@ -129,7 +129,7 @@
* NB: the handler has to clear the source of the interrupt!
* Then it passes the SR flags of interest to BH via adap data
*/
-static void iop3xx_i2c_handler(int this_irq,
+static irqreturn_t iop3xx_i2c_handler(int this_irq,
void *dev_id,
struct pt_regs *regs)
{
@@ -142,6 +142,7 @@
iop3xx_adap->biu->SR_received |= sr;
wake_up_interruptible(&iop3xx_adap->waitq);
}
+ return IRQ_HANDLED;
}
/* check all error conditions, clear them , report most important */
@@ -185,7 +186,7 @@
unsigned sr = 0;
int interrupted;
int done;
- int rc;
+ int rc = 0;
do {
interrupted = wait_event_interruptible_timeout (
@@ -198,13 +199,13 @@
return rc;
}else if (!interrupted) {
*status = sr;
- return rc = -ETIMEDOUT;
+ return -ETIMEDOUT;
}
} while(!done);
*status = sr;
- return rc = 0;
+ return 0;
}
/*
@@ -284,7 +285,7 @@
{
unsigned cr = *iop3xx_adap->biu->CR;
int status;
- int rc;
+ int rc = 0;
*iop3xx_adap->biu->DBR = byte;
cr &= ~IOP321_ICR_MSTART;
@@ -304,7 +305,7 @@
{
unsigned cr = *iop3xx_adap->biu->CR;
int status;
- int rc;
+ int rc = 0;
cr &= ~IOP321_ICR_MSTART;
@@ -386,13 +387,16 @@
iop3xx_adap_reset(iop3xx_adap);
iop3xx_adap_enable(iop3xx_adap);
- for (im = 0; ret = 0 && im != num; ++im) {
+ for (im = 0; ret = 0 && im != num; im++) {
ret = iop3xx_handle_msg(i2c_adap, &msgs[im]);
}
iop3xx_adap_transaction_cleanup(iop3xx_adap);
+
+ if(ret)
+ return ret;
- return ret;
+ return im;
}
static int algo_control(struct i2c_adapter *adapter, unsigned int cmd,
WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, sensors@stimpy.netroedge.com
Subject: Re: [PATCH] i2c driver fixes for 2.6.4
Date: Mon, 15 Mar 2004 14:56:33 -0800 [thread overview]
Message-ID: <10793913932709@kroah.com> (raw)
In-Reply-To: <10793913932371@kroah.com>
ChangeSet 1.1597.1.11, 2004/03/03 10:07:50-08:00, dave.jiang@intel.com
[PATCH] I2C: IOP3xx i2c driver update
Here's a small patch update to the i2c-iop3xx.c in
drivers/i2c/busses/. It fixes some functions' return value and updated
the irq handler to be compatible with kernel 2.6. Thanks!
drivers/i2c/busses/i2c-iop3xx.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff -Nru a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
--- a/drivers/i2c/busses/i2c-iop3xx.c Mon Mar 15 14:35:39 2004
+++ b/drivers/i2c/busses/i2c-iop3xx.c Mon Mar 15 14:35:39 2004
@@ -129,7 +129,7 @@
* NB: the handler has to clear the source of the interrupt!
* Then it passes the SR flags of interest to BH via adap data
*/
-static void iop3xx_i2c_handler(int this_irq,
+static irqreturn_t iop3xx_i2c_handler(int this_irq,
void *dev_id,
struct pt_regs *regs)
{
@@ -142,6 +142,7 @@
iop3xx_adap->biu->SR_received |= sr;
wake_up_interruptible(&iop3xx_adap->waitq);
}
+ return IRQ_HANDLED;
}
/* check all error conditions, clear them , report most important */
@@ -185,7 +186,7 @@
unsigned sr = 0;
int interrupted;
int done;
- int rc;
+ int rc = 0;
do {
interrupted = wait_event_interruptible_timeout (
@@ -198,13 +199,13 @@
return rc;
}else if (!interrupted) {
*status = sr;
- return rc = -ETIMEDOUT;
+ return -ETIMEDOUT;
}
} while(!done);
*status = sr;
- return rc = 0;
+ return 0;
}
/*
@@ -284,7 +285,7 @@
{
unsigned cr = *iop3xx_adap->biu->CR;
int status;
- int rc;
+ int rc = 0;
*iop3xx_adap->biu->DBR = byte;
cr &= ~IOP321_ICR_MSTART;
@@ -304,7 +305,7 @@
{
unsigned cr = *iop3xx_adap->biu->CR;
int status;
- int rc;
+ int rc = 0;
cr &= ~IOP321_ICR_MSTART;
@@ -386,13 +387,16 @@
iop3xx_adap_reset(iop3xx_adap);
iop3xx_adap_enable(iop3xx_adap);
- for (im = 0; ret == 0 && im != num; ++im) {
+ for (im = 0; ret == 0 && im != num; im++) {
ret = iop3xx_handle_msg(i2c_adap, &msgs[im]);
}
iop3xx_adap_transaction_cleanup(iop3xx_adap);
+
+ if(ret)
+ return ret;
- return ret;
+ return im;
}
static int algo_control(struct i2c_adapter *adapter, unsigned int cmd,
next prev parent reply other threads:[~2005-05-19 6:24 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-15 22:48 [BK PATCH] i2c driver fixes for 2.6.4 Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` [PATCH] " Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH [this message]
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2005-05-19 6:24 ` Greg KH
2004-03-15 22:56 ` Greg KH
2004-03-15 22:56 ` Greg KH
2004-03-15 22:56 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=10793913932709@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sensors@stimpy.netroedge.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.