mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 08:19:28 +00:00
leds: convert PCA9633 LED driver to devm_kzalloc()
Cc: Peter Meerwald <p.meerwald@bct-electronic.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
This commit is contained in:
parent
ac63ff50ad
commit
983ce8840c
1 changed files with 1 additions and 5 deletions
|
@ -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;
|
||||
|
||||
|
@ -156,8 +156,6 @@ static int __devinit pca9633_probe(struct i2c_client *client,
|
|||
cancel_work_sync(&pca9633[i].work);
|
||||
}
|
||||
|
||||
kfree(pca9633);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -171,8 +169,6 @@ static int __devexit pca9633_remove(struct i2c_client *client)
|
|||
cancel_work_sync(&pca9633[i].work);
|
||||
}
|
||||
|
||||
kfree(pca9633);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue