Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2286066f authored by Deepak Saxena's avatar Deepak Saxena Committed by Greg Kroah-Hartman
Browse files

[PATCH] i2c: kzalloc conversion, ixp bus drivers



Use kzalloc instead of kmalloc+memzero in the ixp2000 and ixp4xx
I2C bus drivers.

Signed-off-by: default avatarDeepak Saxena <dsaxena@mvista.com>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4d4e5ce8
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -106,11 +106,10 @@ static int ixp2000_i2c_probe(struct device *dev)
	struct platform_device *plat_dev = to_platform_device(dev);
	struct ixp2000_i2c_pins *gpio = plat_dev->dev.platform_data;
	struct ixp2000_i2c_data *drv_data = 
		kmalloc(sizeof(struct ixp2000_i2c_data), GFP_KERNEL);
		kzalloc(sizeof(struct ixp2000_i2c_data), GFP_KERNEL);

	if (!drv_data)
		return -ENOMEM;
	memzero(drv_data, sizeof(*drv_data));
	drv_data->gpio_pins = gpio;

	drv_data->algo_data.data = gpio;
+1 −2
Original line number Diff line number Diff line
@@ -107,12 +107,11 @@ static int ixp4xx_i2c_probe(struct device *dev)
	struct platform_device *plat_dev = to_platform_device(dev);
	struct ixp4xx_i2c_pins *gpio = plat_dev->dev.platform_data;
	struct ixp4xx_i2c_data *drv_data = 
		kmalloc(sizeof(struct ixp4xx_i2c_data), GFP_KERNEL);
		kzalloc(sizeof(struct ixp4xx_i2c_data), GFP_KERNEL);

	if(!drv_data)
		return -ENOMEM;

	memzero(drv_data, sizeof(struct ixp4xx_i2c_data));
	drv_data->gpio_pins = gpio;

	/*