mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
bus: arm-ccn: Simplify code
Use 'devm_kasprintf()' to simplify the code. Signed-off-by: Christophe JAILLET <[email protected]> Acked-by: Scott Branden <[email protected]> Signed-off-by: Pawel Moll <[email protected]>
This commit is contained in:
parent
24771179c5
commit
0f9afd36ba
1 changed files with 2 additions and 4 deletions
|
|
@ -1268,14 +1268,12 @@ static int arm_ccn_pmu_init(struct arm_ccn *ccn)
|
|||
if (ccn->dt.id == 0) {
|
||||
name = "ccn";
|
||||
} else {
|
||||
int len = snprintf(NULL, 0, "ccn_%d", ccn->dt.id);
|
||||
|
||||
name = devm_kzalloc(ccn->dev, len + 1, GFP_KERNEL);
|
||||
name = devm_kasprintf(ccn->dev, GFP_KERNEL, "ccn_%d",
|
||||
ccn->dt.id);
|
||||
if (!name) {
|
||||
err = -ENOMEM;
|
||||
goto error_choose_name;
|
||||
}
|
||||
snprintf(name, len + 1, "ccn_%d", ccn->dt.id);
|
||||
}
|
||||
|
||||
/* Perf driver registration */
|
||||
|
|
|
|||
Loading…
Reference in a new issue