Merge mulgrave-w:git/scsi-misc-2.6
[pandora-kernel.git] / drivers / net / bmac.c
index 60dba4a..7116096 100644 (file)
@@ -7,7 +7,6 @@
  * May 1999, Al Viro: proper release of /proc/net/bmac entry, switched to
  * dynamic procfs inode.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
@@ -1265,7 +1264,8 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i
 {
        int j, rev, ret;
        struct bmac_data *bp;
-       unsigned char *addr;
+       const unsigned char *prop_addr;
+       unsigned char addr[6];
        struct net_device *dev;
        int is_bmac_plus = ((int)match->data) != 0;
 
@@ -1273,14 +1273,16 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i
                printk(KERN_ERR "BMAC: can't use, need 3 addrs and 3 intrs\n");
                return -ENODEV;
        }
-       addr = get_property(macio_get_of_node(mdev), "mac-address", NULL);
-       if (addr == NULL) {
-               addr = get_property(macio_get_of_node(mdev), "local-mac-address", NULL);
-               if (addr == NULL) {
+       prop_addr = get_property(macio_get_of_node(mdev), "mac-address", NULL);
+       if (prop_addr == NULL) {
+               prop_addr = get_property(macio_get_of_node(mdev),
+                               "local-mac-address", NULL);
+               if (prop_addr == NULL) {
                        printk(KERN_ERR "BMAC: Can't get mac-address\n");
                        return -ENODEV;
                }
        }
+       memcpy(addr, prop_addr, sizeof(addr));
 
        dev = alloc_etherdev(PRIV_BYTES);
        if (!dev) {
@@ -1658,6 +1660,7 @@ static struct of_device_id bmac_match[] =
        },
        {},
 };
+MODULE_DEVICE_TABLE (of, bmac_match);
 
 static struct macio_driver bmac_driver = 
 {
@@ -1689,10 +1692,8 @@ static void __exit bmac_exit(void)
 {
        macio_unregister_driver(&bmac_driver);
 
-       if (bmac_emergency_rxbuf != NULL) {
-               kfree(bmac_emergency_rxbuf);
-               bmac_emergency_rxbuf = NULL;
-       }
+       kfree(bmac_emergency_rxbuf);
+       bmac_emergency_rxbuf = NULL;
 }
 
 MODULE_AUTHOR("Randy Gobbel/Paul Mackerras");