aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/chelsio
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-12-01 19:36:14 -0500
committerJeff Garzik <jeff@garzik.org>2006-12-02 00:24:49 -0500
commit1270266cf94c0de5bd1121f15aff9af8556dee84 (patch)
tree922611128fd47dd08c7f1b83666ef2207fd09d76 /drivers/net/chelsio
parent11e5a202ca9e93ecb5ff314a6a345e0e4db77d97 (diff)
[PATCH] chelsio: use kzalloc
Use kzalloc in several places. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/chelsio')
-rw-r--r--drivers/net/chelsio/mv88x201x.c4
-rw-r--r--drivers/net/chelsio/pm3393.c3
2 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/chelsio/mv88x201x.c b/drivers/net/chelsio/mv88x201x.c
index db5034282782..bf7d8538885d 100644
--- a/drivers/net/chelsio/mv88x201x.c
+++ b/drivers/net/chelsio/mv88x201x.c
@@ -205,11 +205,11 @@ static struct cphy *mv88x201x_phy_create(adapter_t *adapter, int phy_addr,
205 struct mdio_ops *mdio_ops) 205 struct mdio_ops *mdio_ops)
206{ 206{
207 u32 val; 207 u32 val;
208 struct cphy *cphy = kmalloc(sizeof(*cphy), GFP_KERNEL); 208 struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL);
209 209
210 if (!cphy) 210 if (!cphy)
211 return NULL; 211 return NULL;
212 memset(cphy, 0, sizeof(*cphy)); 212
213 cphy_init(cphy, adapter, phy_addr, &mv88x201x_ops, mdio_ops); 213 cphy_init(cphy, adapter, phy_addr, &mv88x201x_ops, mdio_ops);
214 214
215 /* Commands the PHY to enable XFP's clock. */ 215 /* Commands the PHY to enable XFP's clock. */
diff --git a/drivers/net/chelsio/pm3393.c b/drivers/net/chelsio/pm3393.c
index b442b585b4b1..50983f9ce4bc 100644
--- a/drivers/net/chelsio/pm3393.c
+++ b/drivers/net/chelsio/pm3393.c
@@ -631,10 +631,9 @@ static struct cmac *pm3393_mac_create(adapter_t *adapter, int index)
631{ 631{
632 struct cmac *cmac; 632 struct cmac *cmac;
633 633
634 cmac = kmalloc(sizeof(*cmac) + sizeof(cmac_instance), GFP_KERNEL); 634 cmac = kzalloc(sizeof(*cmac) + sizeof(cmac_instance), GFP_KERNEL);
635 if (!cmac) 635 if (!cmac)
636 return NULL; 636 return NULL;
637 memset(cmac, 0, sizeof(*cmac));
638 637
639 cmac->ops = &pm3393_ops; 638 cmac->ops = &pm3393_ops;
640 cmac->instance = (cmac_instance *) (cmac + 1); 639 cmac->instance = (cmac_instance *) (cmac + 1);