diff options
author | Christophe Jaillet <christophe.jaillet@wanadoo.fr> | 2015-05-01 13:58:19 (GMT) |
---|---|---|
committer | Jesper Nilsson <jespern@axis.com> | 2015-09-04 22:33:24 (GMT) |
commit | 6a4756f6951f97a9a601ba24632c5906750ef00d (patch) | |
tree | 34164b443bba232e2dc729c467cb5e042ea844ea | |
parent | 51e771c0d25b43d0f12b2c7c01939942becbbe28 (diff) | |
download | linux-6a4756f6951f97a9a601ba24632c5906750ef00d.tar.xz |
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 009f4ee..72968fb 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; |