diff options
author | Christophe Jaillet <christophe.jaillet@wanadoo.fr> | 2015-05-01 15:58:19 +0200 |
---|---|---|
committer | Jesper Nilsson <jespern@axis.com> | 2015-09-05 00:33:24 +0200 |
commit | 6a4756f6951f97a9a601ba24632c5906750ef00d (patch) | |
tree | 34164b443bba232e2dc729c467cb5e042ea844ea | |
parent | 51e771c0d25b43d0f12b2c7c01939942becbbe28 (diff) |
cris: arch-v32: gpio: Use kzalloc instead of kmalloc/memset
Turn a kmalloc/memset into an equivalent kzalloc.
Doing so also move the zero'ing of the memory outside of a mutex.
Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jesper Nilsson <jespern@axis.com>
-rw-r--r-- | arch/cris/arch-v32/drivers/mach-fs/gpio.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/cris/arch-v32/drivers/mach-fs/gpio.c b/arch/cris/arch-v32/drivers/mach-fs/gpio.c index 009f4ee1bd09..72968fbf814b 100644 --- a/arch/cris/arch-v32/drivers/mach-fs/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-fs/gpio.c @@ -425,12 +425,11 @@ gpio_open(struct inode *inode, struct file *filp) if (p > GPIO_MINOR_LAST) return -EINVAL; - priv = kmalloc(sizeof(struct gpio_private), GFP_KERNEL); + priv = kzalloc(sizeof(struct gpio_private), GFP_KERNEL); if (!priv) return -ENOMEM; mutex_lock(&gpio_mutex); - memset(priv, 0, sizeof(*priv)); priv->minor = p; |