Fix region size check in mpc5200 FEC driver
authorGrant Likely <grant.likely@secretlab.ca>
Thu, 1 Nov 2007 14:22:35 +0000 (08:22 -0600)
committerJeff Garzik <jeff@garzik.org>
Thu, 1 Nov 2007 20:04:45 +0000 (16:04 -0400)
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>
drivers/net/fec_mpc52xx.c

index fc1cf0b742b0d001c8f26af6354534686766233a..a8a0ee220da671c5124ad6af4314454cce6685f2 100644 (file)
@@ -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;
        }