* [PATCH 4/5] staging/gdm72xx: use kzalloc for phydev and sdev
@ 2012-07-12 6:13 Devendra Naga
0 siblings, 0 replies; only message in thread
From: Devendra Naga @ 2012-07-12 6:13 UTC (permalink / raw)
To: Greg Kroah-Hartman, Sage Ahn, Devendra Naga, devel, linux-kernel
in sdio probe function we are doing kmalloc which can be done using kzalloc.
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
---
drivers/staging/gdm72xx/gdm_sdio.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/gdm72xx/gdm_sdio.c b/drivers/staging/gdm72xx/gdm_sdio.c
index 5e19b09..3e43c01 100644
--- a/drivers/staging/gdm72xx/gdm_sdio.c
+++ b/drivers/staging/gdm72xx/gdm_sdio.c
@@ -664,20 +664,17 @@ static int sdio_wimax_probe(struct sdio_func *func,
if (ret)
return ret;
- phy_dev = kmalloc(sizeof(*phy_dev), GFP_KERNEL);
+ phy_dev = kzalloc(sizeof(*phy_dev), GFP_KERNEL);
if (phy_dev == NULL) {
ret = -ENOMEM;
goto out;
}
- sdev = kmalloc(sizeof(*sdev), GFP_KERNEL);
+ sdev = kzalloc(sizeof(*sdev), GFP_KERNEL);
if (sdev == NULL) {
ret = -ENOMEM;
goto out;
}
- memset(phy_dev, 0, sizeof(*phy_dev));
- memset(sdev, 0, sizeof(*sdev));
-
phy_dev->priv_dev = (void *)sdev;
phy_dev->send_func = gdm_sdio_send;
phy_dev->rcv_func = gdm_sdio_receive;
--
1.7.9.5
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-07-12 6:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-12 6:13 [PATCH 4/5] staging/gdm72xx: use kzalloc for phydev and sdev Devendra Naga
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome