summaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorAndrew Davis <afd@ti.com>2024-08-02 13:22:54 -0500
committerMathieu Poirier <mathieu.poirier@linaro.org>2024-08-13 09:37:40 -0600
commitd32e71660056455ff0af73e10d239d4043d9c1a5 (patch)
tree5fb1c6c6ed46921833fb7f768b9ce221464f216a /drivers/remoteproc
parent74de9654abf7cd0ab46d2393889f3f28b6384db8 (diff)
downloadlinux-d32e71660056455ff0af73e10d239d4043d9c1a5.tar.gz
linux-d32e71660056455ff0af73e10d239d4043d9c1a5.tar.bz2
linux-d32e71660056455ff0af73e10d239d4043d9c1a5.zip
remoteproc: keystone: Use devm_kasprintf() to build name string
This is simpler and removes the need to assume the id length to be 1 digit, which then removes a W=1 compile warning about the same. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20240802182300.244055-1-afd@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/keystone_remoteproc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/remoteproc/keystone_remoteproc.c b/drivers/remoteproc/keystone_remoteproc.c
index 7e57b90bcaf8..81b179e269a1 100644
--- a/drivers/remoteproc/keystone_remoteproc.c
+++ b/drivers/remoteproc/keystone_remoteproc.c
@@ -366,8 +366,6 @@ static int keystone_rproc_probe(struct platform_device *pdev)
struct rproc *rproc;
int dsp_id;
char *fw_name = NULL;
- char *template = "keystone-dsp%d-fw";
- int name_len = 0;
int ret = 0;
if (!np) {
@@ -382,11 +380,9 @@ static int keystone_rproc_probe(struct platform_device *pdev)
}
/* construct a custom default fw name - subject to change in future */
- name_len = strlen(template); /* assuming a single digit alias */
- fw_name = devm_kzalloc(dev, name_len, GFP_KERNEL);
+ fw_name = devm_kasprintf(dev, GFP_KERNEL, "keystone-dsp%d-fw", dsp_id);
if (!fw_name)
return -ENOMEM;
- snprintf(fw_name, name_len, template, dsp_id);
rproc = rproc_alloc(dev, dev_name(dev), &keystone_rproc_ops, fw_name,
sizeof(*ksproc));