summaryrefslogtreecommitdiff
path: root/drivers/remoteproc/keystone_remoteproc.c
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2024-09-27 08:13:52 +0200
committerPaolo Abeni <pabeni@redhat.com>2024-09-27 08:13:52 +0200
commit3a39d672e7f48b8d6b91a09afa4b55352773b4b5 (patch)
treef7ec4043b508f48430dd09ac338c38acf7d5a6cd /drivers/remoteproc/keystone_remoteproc.c
parent151ac45348afc5b56baa584c7cd4876addf461ff (diff)
parent62a0e2fa40c5c06742b8b4997ba5095a3ec28503 (diff)
downloadlwn-3a39d672e7f48b8d6b91a09afa4b55352773b4b5.tar.gz
lwn-3a39d672e7f48b8d6b91a09afa4b55352773b4b5.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR. No conflicts and no adjacent changes. Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/remoteproc/keystone_remoteproc.c')
-rw-r--r--drivers/remoteproc/keystone_remoteproc.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/remoteproc/keystone_remoteproc.c b/drivers/remoteproc/keystone_remoteproc.c
index 7e57b90bcaf8..8f0f7a4cfef2 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,14 +380,12 @@ 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));
+ rproc = devm_rproc_alloc(dev, dev_name(dev), &keystone_rproc_ops,
+ fw_name, sizeof(*ksproc));
if (!rproc)
return -ENOMEM;
@@ -400,13 +396,11 @@ static int keystone_rproc_probe(struct platform_device *pdev)
ret = keystone_rproc_of_get_dev_syscon(pdev, ksproc);
if (ret)
- goto free_rproc;
+ return ret;
ksproc->reset = devm_reset_control_get_exclusive(dev, NULL);
- if (IS_ERR(ksproc->reset)) {
- ret = PTR_ERR(ksproc->reset);
- goto free_rproc;
- }
+ if (IS_ERR(ksproc->reset))
+ return PTR_ERR(ksproc->reset);
/* enable clock for accessing DSP internal memories */
pm_runtime_enable(dev);
@@ -471,8 +465,6 @@ disable_clk:
pm_runtime_put_sync(dev);
disable_rpm:
pm_runtime_disable(dev);
-free_rproc:
- rproc_free(rproc);
return ret;
}
@@ -484,7 +476,6 @@ static void keystone_rproc_remove(struct platform_device *pdev)
gpiod_put(ksproc->kick_gpio);
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
- rproc_free(ksproc->rproc);
of_reserved_mem_device_release(&pdev->dev);
}