diff options
author | Christophe Jaillet <christophe.jaillet@wanadoo.fr> | 2015-05-01 09:58:19 -0400 |
---|---|---|
committer | Jesper Nilsson <jespern@axis.com> | 2015-09-04 18:33:24 -0400 |
commit | 6a4756f6951f97a9a601ba24632c5906750ef00d (patch) | |
tree | 34164b443bba232e2dc729c467cb5e042ea844ea /arch/cris/arch-v32 | |
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>
Diffstat (limited to 'arch/cris/arch-v32')
-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) | |||
425 | if (p > GPIO_MINOR_LAST) | 425 | if (p > GPIO_MINOR_LAST) |
426 | return -EINVAL; | 426 | return -EINVAL; |
427 | 427 | ||
428 | priv = kmalloc(sizeof(struct gpio_private), GFP_KERNEL); | 428 | priv = kzalloc(sizeof(struct gpio_private), GFP_KERNEL); |
429 | if (!priv) | 429 | if (!priv) |
430 | return -ENOMEM; | 430 | return -ENOMEM; |
431 | 431 | ||
432 | mutex_lock(&gpio_mutex); | 432 | mutex_lock(&gpio_mutex); |
433 | memset(priv, 0, sizeof(*priv)); | ||
434 | 433 | ||
435 | priv->minor = p; | 434 | priv->minor = p; |
436 | 435 | ||