Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f9afd36 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Pawel Moll
Browse files

bus: arm-ccn: Simplify code



Use 'devm_kasprintf()' to simplify the code.

Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: default avatarScott Branden <scott.branden@broadcom.com>
Signed-off-by: default avatarPawel Moll <pawel.moll@arm.com>
parent 24771179
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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 */