summaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v32/drivers
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2015-05-01 15:58:19 +0200
committerJesper Nilsson <jespern@axis.com>2015-09-05 00:33:24 +0200
commit6a4756f6951f97a9a601ba24632c5906750ef00d (patch)
tree34164b443bba232e2dc729c467cb5e042ea844ea /arch/cris/arch-v32/drivers
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dto... (diff)
downloadlinux-6a4756f6951f97a9a601ba24632c5906750ef00d.tar.xz
linux-6a4756f6951f97a9a601ba24632c5906750ef00d.zip
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/drivers')
-rw-r--r--arch/cris/arch-v32/drivers/mach-fs/gpio.c3
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;