From 2e6679a0aa352e6b74f6385c49cd4dca3dc7201f Mon Sep 17 00:00:00 2001 From: vignesh babu Date: Tue, 17 Apr 2007 12:42:09 -0700 Subject: [SBUS] vfc_dev.c: kzalloc Replacing kmalloc/memset combination with kzalloc. Signed-off-by: vignesh babu Signed-off-by: David S. Miller --- drivers/sbus/char/vfc_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index 8bfb67ccdcd4..c3135e2fbd5a 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c @@ -259,11 +259,10 @@ static int vfc_debug(struct vfc_dev *dev, int cmd, void __user *argp) if (copy_from_user(&inout, argp, sizeof(inout))) return -EFAULT; - buffer = kmalloc(inout.len, GFP_KERNEL); + buffer = kzalloc(inout.len, GFP_KERNEL); if (buffer == NULL) return -ENOMEM; - memset(buffer,0,inout.len); vfc_lock_device(dev); inout.ret= vfc_i2c_recvbuf(dev,inout.addr & 0xff -- cgit v1.2.1 From d0dc1129c2e5a5a0e53940cad44333e6bd2f9af3 Mon Sep 17 00:00:00 2001 From: Marcel van Nies Date: Sat, 21 Apr 2007 15:31:58 -0700 Subject: [SUNQE]: Fix MAC address assignment. The MAC address assignment at module loading is simply forgotten. The bug at module unloading is caused by an incorrect call. The bug at module unloading does not only happen for sunqe, sunlance and sunhme (sbus) suffer from it too. I've tested this on my SS20. Signed-off-by: Marcel van Nies Signed-off-by: David S. Miller --- drivers/net/sunqe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c index 7874eb1ef043..f3bad56d476a 100644 --- a/drivers/net/sunqe.c +++ b/drivers/net/sunqe.c @@ -845,6 +845,8 @@ static int __init qec_ether_init(struct sbus_dev *sdev) if (!dev) return -ENOMEM; + memcpy(dev->dev_addr, idprom->id_ethaddr, 6); + qe = netdev_priv(dev); i = of_getintprop_default(sdev->ofdev.node, "channel#", -1); @@ -960,7 +962,7 @@ static int __devexit qec_sbus_remove(struct of_device *dev) struct sunqe *qp = dev_get_drvdata(&dev->dev); struct net_device *net_dev = qp->dev; - unregister_netdevice(net_dev); + unregister_netdev(net_dev); sbus_iounmap(qp->qcregs, CREG_REG_SIZE); sbus_iounmap(qp->mregs, MREGS_REG_SIZE); -- cgit v1.2.1 From 9f9b6693ed8254177bafcb823b0ea3659d61adb0 Mon Sep 17 00:00:00 2001 From: Marcel van Nies Date: Sat, 21 Apr 2007 15:34:10 -0700 Subject: [SUNLANCE]: Fix module unload. Signed-off-by: Marcel van Nies Signed-off-by: David S. Miller --- drivers/net/sunlance.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c index 5b00d79b5573..b0929a457b60 100644 --- a/drivers/net/sunlance.c +++ b/drivers/net/sunlance.c @@ -1550,7 +1550,7 @@ static int __exit sunlance_sun4_remove(void) struct lance_private *lp = dev_get_drvdata(&sun4_sdev.ofdev.dev); struct net_device *net_dev = lp->dev; - unregister_netdevice(net_dev); + unregister_netdev(net_dev); lance_free_hwresources(lp); @@ -1590,7 +1590,7 @@ static int __devexit sunlance_sbus_remove(struct of_device *dev) struct lance_private *lp = dev_get_drvdata(&dev->dev); struct net_device *net_dev = lp->dev; - unregister_netdevice(net_dev); + unregister_netdev(net_dev); lance_free_hwresources(lp); -- cgit v1.2.1 From c3b99f0db9b2ef4292ef774bae1ea0d6f1e8d82a Mon Sep 17 00:00:00 2001 From: Marcel van Nies Date: Sat, 21 Apr 2007 15:34:55 -0700 Subject: [SUNHME]: Fix module unload. Signed-off-by: Marcel van Nies Signed-off-by: David S. Miller --- drivers/net/sunhme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index ef671739cfea..192bbc91c731 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c @@ -3314,7 +3314,7 @@ static int __devexit hme_sbus_remove(struct of_device *dev) struct happy_meal *hp = dev_get_drvdata(&dev->dev); struct net_device *net_dev = hp->dev; - unregister_netdevice(net_dev); + unregister_netdev(net_dev); /* XXX qfe parent interrupt... */ -- cgit v1.2.1