Skip to content

Commit

Permalink
powerpc/mpc5200: Fix wrong 'no interrupt' handling in of_i2c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wolfram Sang authored and Grant Likely committed Jul 22, 2008
1 parent e89970a commit 11d579e
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/of/of_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 11d579e

Please sign in to comment.