提交 48d58459 编写于 作者: G Grant Likely 提交者: Jeff Garzik

Fix region size check in mpc5200 FEC driver

Driver shouldn't complain if the register range is larger than what
it expects.  This works around failures with some device trees.
Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 644fdf9b
......@@ -879,9 +879,9 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
"Error while parsing device node resource\n" );
return rv;
}
if ((mem.end - mem.start + 1) != sizeof(struct mpc52xx_fec)) {
if ((mem.end - mem.start + 1) < sizeof(struct mpc52xx_fec)) {
printk(KERN_ERR DRIVER_NAME
" - invalid resource size (%lx != %x), check mpc52xx_devices.c\n",
" - invalid resource size (%lx < %x), check mpc52xx_devices.c\n",
(unsigned long)(mem.end - mem.start + 1), sizeof(struct mpc52xx_fec));
return -EINVAL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册