Skip to content

Commit

Permalink
Fix region size check in mpc5200 FEC driver
Browse files Browse the repository at this point in the history
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: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Grant Likely authored and Jeff Garzik committed Nov 1, 2007
1 parent 644fdf9 commit 48d5845
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/fec_mpc52xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 48d5845

Please sign in to comment.