diff mbox

[1/3] i2c/mpc: drop NO_IRQ

Message ID 1256245888-25210-2-git-send-email-w.sang@pengutronix.de (mailing list archive)
State Accepted, archived
Commit 8f85c0af2388d575a598d2695319ccb7e1b5523c
Delegated to: Grant Likely
Headers show

Commit Message

Wolfram Sang Oct. 22, 2009, 9:11 p.m. UTC
Drop NO_IRQ as 0 is the preferred way to describe 'no irq'
(http://lkml.org/lkml/2005/11/21/221). This change is safe, as the driver is
only used on powerpc, where NO_IRQ is 0 anyhow.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Ben Dooks <ben-linux@fluff.org>
---
 drivers/i2c/busses/i2c-mpc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Comments

Grant Likely Feb. 16, 2010, 3:59 p.m. UTC | #1
On Thu, Oct 22, 2009 at 2:11 PM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> Drop NO_IRQ as 0 is the preferred way to describe 'no irq'
> (http://lkml.org/lkml/2005/11/21/221). This change is safe, as the driver is
> only used on powerpc, where NO_IRQ is 0 anyhow.
>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Ben Dooks <ben-linux@fluff.org>

Acked-by: Grant Likely <grant.likely@secretlab.ca>

> ---
>  drivers/i2c/busses/i2c-mpc.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
> index d325e86..7e58443 100644
> --- a/drivers/i2c/busses/i2c-mpc.c
> +++ b/drivers/i2c/busses/i2c-mpc.c
> @@ -115,7 +115,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
>        u32 x;
>        int result = 0;
>
> -       if (i2c->irq == NO_IRQ) {
> +       if (!i2c->irq) {
>                while (!(readb(i2c->base + MPC_I2C_SR) & CSR_MIF)) {
>                        schedule();
>                        if (time_after(jiffies, orig_jiffies + timeout)) {
> @@ -520,7 +520,7 @@ static int __devinit fsl_i2c_probe(struct of_device *op,
>        }
>
>        i2c->irq = irq_of_parse_and_map(op->node, 0);
> -       if (i2c->irq != NO_IRQ) { /* i2c->irq = NO_IRQ implies polling */
> +       if (i2c->irq) { /* no i2c->irq implies polling */
>                result = request_irq(i2c->irq, mpc_i2c_isr,
>                                     IRQF_SHARED, "i2c-mpc", i2c);
>                if (result < 0) {
> @@ -579,7 +579,7 @@ static int __devexit fsl_i2c_remove(struct of_device *op)
>        i2c_del_adapter(&i2c->adap);
>        dev_set_drvdata(&op->dev, NULL);
>
> -       if (i2c->irq != NO_IRQ)
> +       if (i2c->irq)
>                free_irq(i2c->irq, i2c);
>
>        irq_dispose_mapping(i2c->irq);
> --
> 1.6.5
>
>
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index d325e86..7e58443 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -115,7 +115,7 @@  static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
 	u32 x;
 	int result = 0;
 
-	if (i2c->irq == NO_IRQ) {
+	if (!i2c->irq) {
 		while (!(readb(i2c->base + MPC_I2C_SR) & CSR_MIF)) {
 			schedule();
 			if (time_after(jiffies, orig_jiffies + timeout)) {
@@ -520,7 +520,7 @@  static int __devinit fsl_i2c_probe(struct of_device *op,
 	}
 
 	i2c->irq = irq_of_parse_and_map(op->node, 0);
-	if (i2c->irq != NO_IRQ) { /* i2c->irq = NO_IRQ implies polling */
+	if (i2c->irq) { /* no i2c->irq implies polling */
 		result = request_irq(i2c->irq, mpc_i2c_isr,
 				     IRQF_SHARED, "i2c-mpc", i2c);
 		if (result < 0) {
@@ -579,7 +579,7 @@  static int __devexit fsl_i2c_remove(struct of_device *op)
 	i2c_del_adapter(&i2c->adap);
 	dev_set_drvdata(&op->dev, NULL);
 
-	if (i2c->irq != NO_IRQ)
+	if (i2c->irq)
 		free_irq(i2c->irq, i2c);
 
 	irq_dispose_mapping(i2c->irq);