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>
This commit is contained in:
Christophe Jaillet 2015-05-01 15:58:19 +02:00 committed by Jesper Nilsson
parent 51e771c0d2
commit 6a4756f695

View File

@ -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;