Skip to content

Commit

Permalink
leds: convert PCA9633 LED driver to devm_kzalloc()
Browse files Browse the repository at this point in the history
Cc: Peter Meerwald <p.meerwald@bct-electronic.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
  • Loading branch information
Bryan Wu committed Jul 23, 2012
1 parent ac63ff5 commit 983ce88
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/leds/leds-pca9633.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static int __devinit pca9633_probe(struct i2c_client *client,
}
}

pca9633 = kcalloc(4, sizeof(*pca9633), GFP_KERNEL);
pca9633 = devm_kzalloc(&client->dev, 4 * sizeof(*pca9633), GFP_KERNEL);
if (!pca9633)
return -ENOMEM;

Expand Down Expand Up @@ -156,8 +156,6 @@ static int __devinit pca9633_probe(struct i2c_client *client,
cancel_work_sync(&pca9633[i].work);
}

kfree(pca9633);

return err;
}

Expand All @@ -171,8 +169,6 @@ static int __devexit pca9633_remove(struct i2c_client *client)
cancel_work_sync(&pca9633[i].work);
}

kfree(pca9633);

return 0;
}

Expand Down

0 comments on commit 983ce88

Please sign in to comment.