Patchwork [3/7] i2c/rtc-ds3232: Fix irq for probing

login
register
mail settings
Submitter York Sun
Date Sept. 6, 2013, 3:43 p.m.
Message ID <1378482199-10581-3-git-send-email-yorksun@freescale.com>
Download mbox | patch
Permalink /patch/273241/
State Not Applicable
Headers show

Comments

York Sun - Sept. 6, 2013, 3:43 p.m.
Driver shouldn't request irq when irq = 0. It is returned from parsing
device tree. 0 means no interrupt.

Signed-off-by: York Sun <yorksun@freescale.com>
Reviewed-by: Zang Tiefei-R61911 <tie-fei.zang@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
---
 drivers/rtc/rtc-ds3232.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Scott Wood - Sept. 10, 2013, 10:26 p.m.
On Fri, 2013-09-06 at 08:43 -0700, York Sun wrote:
> Driver shouldn't request irq when irq = 0. It is returned from parsing
> device tree. 0 means no interrupt.
> 
> Signed-off-by: York Sun <yorksun@freescale.com>
> Reviewed-by: Zang Tiefei-R61911 <tie-fei.zang@freescale.com>
> Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
> ---
>  drivers/rtc/rtc-ds3232.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This should go via the i2c list and maintainer.  It's not a PPC patch at
all.

Please do not lump unrelated patches into a single patchset.

-Scott

Patch

diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c
index b83bb5a5..ae8a28e 100644
--- a/drivers/rtc/rtc-ds3232.c
+++ b/drivers/rtc/rtc-ds3232.c
@@ -418,7 +418,7 @@  static int ds3232_probe(struct i2c_client *client,
 		return PTR_ERR(ds3232->rtc);
 	}
 
-	if (client->irq >= 0) {
+	if (client->irq > 0) {
 		ret = devm_request_irq(&client->dev, client->irq, ds3232_irq, 0,
 				 "ds3232", client);
 		if (ret) {