aboutsummaryrefslogtreecommitdiff
path: root/drivers/bus/arm-ccn.c
diff options
context:
space:
mode:
authorChristophe JAILLET2017-08-27 11:07:06 +0100
committerPawel Moll2017-12-04 16:49:50 +0000
commit0f9afd36bac9543bc087b77016311c3394bd77c2 (patch)
tree4045d40518548e3912490aa20a686c4072e4e50d /drivers/bus/arm-ccn.c
parent24771179c5c138f0ea3ef88b7972979f62f2d5db (diff)
bus: arm-ccn: Simplify code
Use 'devm_kasprintf()' to simplify the code. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Scott Branden <scott.branden@broadcom.com> Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Diffstat (limited to 'drivers/bus/arm-ccn.c')
-rw-r--r--drivers/bus/arm-ccn.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
index a7951662f85b..bbc1a2ef9639 100644
--- a/drivers/bus/arm-ccn.c
+++ b/drivers/bus/arm-ccn.c
@@ -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 */