提交 11d579ee 编写于 作者: W Wolfram Sang 提交者: Grant Likely

powerpc/mpc5200: Fix wrong 'no interrupt' handling in of_i2c

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: NWolfram Sang <w.sang@pengutronix.de>
Acked-by: NSean MacLennan <smaclennan@pikatech.com>
Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
上级 e89970aa
...@@ -91,8 +91,6 @@ void of_register_i2c_devices(struct i2c_adapter *adap, ...@@ -91,8 +91,6 @@ void of_register_i2c_devices(struct i2c_adapter *adap,
} }
info.irq = irq_of_parse_and_map(node, 0); 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) { if (of_find_i2c_driver(node, &info) < 0) {
irq_dispose_mapping(info.irq); irq_dispose_mapping(info.irq);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册