]> err.no Git - linux-2.6/commitdiff
powerpc/mpc5200: Fix wrong 'no interrupt' handling in of_i2c
authorWolfram Sang <w.sang@pengutronix.de>
Sat, 28 Jun 2008 18:31:52 +0000 (20:31 +0200)
committerGrant Likely <grant.likely@secretlab.ca>
Tue, 22 Jul 2008 07:13:04 +0000 (01:13 -0600)
If an I2C device node does not specify an interrupt, the .irq member of the
board_info struct was set to -1. This caused crashes on following
irq_dispose_mappings. Leave it NO_IRQ as returned from irq_of_parse_and_map.
(Suggesting -1 as 'i2c-no-irq' used to be a bug in linux/i2c.h.)

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Sean MacLennan <smaclennan@pikatech.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/of/of_i2c.c

index 5c015d310d4a9a92b493cbd7d34691c85dd6b992..344e1b03dd8b708661fcb08982d27ebd79bd586b 100644 (file)
@@ -91,8 +91,6 @@ void of_register_i2c_devices(struct i2c_adapter *adap,
                }
 
                info.irq = irq_of_parse_and_map(node, 0);
-               if (info.irq == NO_IRQ)
-                       info.irq = -1;
 
                if (of_find_i2c_driver(node, &info) < 0) {
                        irq_dispose_mapping(info.irq);