Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331549
b: refs/heads/master
c: 2614a85
h: refs/heads/master
i:
  331547: 05f4598
v: v3
  • Loading branch information
Maxime Ripard authored and Jean Delvare committed Oct 5, 2012
1 parent 97b075c commit de7327c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ad7ea18ae8c7ddda46b7276e0bda73e707ea9c1
refs/heads/master: 2614a8594152cad49047ed02255a3d9fbbbea8dd
14 changes: 5 additions & 9 deletions trunk/drivers/i2c/muxes/i2c-mux-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,20 @@ static int __devinit i2c_mux_gpio_probe(struct platform_device *pdev)
return -ENODEV;
}

mux = kzalloc(sizeof(*mux), GFP_KERNEL);
mux = devm_kzalloc(&pdev->dev, sizeof(*mux), GFP_KERNEL);
if (!mux) {
ret = -ENOMEM;
goto alloc_failed;
}

mux->parent = parent;
mux->data = *pdata;
mux->adap = kzalloc(sizeof(struct i2c_adapter *) * pdata->n_values,
GFP_KERNEL);
mux->adap = devm_kzalloc(&pdev->dev,
sizeof(*mux->adap) * pdata->n_values,
GFP_KERNEL);
if (!mux->adap) {
ret = -ENOMEM;
goto alloc_failed2;
goto alloc_failed;
}

if (pdata->idle != I2C_MUX_GPIO_NO_IDLE) {
Expand Down Expand Up @@ -130,9 +131,6 @@ static int __devinit i2c_mux_gpio_probe(struct platform_device *pdev)
err_request_gpio:
for (; i > 0; i--)
gpio_free(pdata->gpios[i - 1]);
kfree(mux->adap);
alloc_failed2:
kfree(mux);
alloc_failed:
i2c_put_adapter(parent);

Expand All @@ -152,8 +150,6 @@ static int __devexit i2c_mux_gpio_remove(struct platform_device *pdev)

platform_set_drvdata(pdev, NULL);
i2c_put_adapter(mux->parent);
kfree(mux->adap);
kfree(mux);

return 0;
}
Expand Down

0 comments on commit de7327c

Please sign in to comment.