[PATCH] i2c: kzalloc conversion, other drivers
Use kzalloc instead of kmalloc+memset in all remaining i2c bus and chip drivers. Signed-off-by: Deepak Saxena <dsaxena@plexity.net> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ba9c2e8d15
commit
5263ebb51e
@@ -80,10 +80,9 @@ static struct i2c_dev *get_free_i2c_dev(struct i2c_adapter *adap)
|
||||
{
|
||||
struct i2c_dev *i2c_dev;
|
||||
|
||||
i2c_dev = kmalloc(sizeof(*i2c_dev), GFP_KERNEL);
|
||||
i2c_dev = kzalloc(sizeof(*i2c_dev), GFP_KERNEL);
|
||||
if (!i2c_dev)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
memset(i2c_dev, 0x00, sizeof(*i2c_dev));
|
||||
|
||||
spin_lock(&i2c_dev_array_lock);
|
||||
if (i2c_dev_array[adap->nr]) {
|
||||
|
||||
Reference in New Issue
Block a user