Skip to content

Commit 2570a24

Browse files
committed
Merge tag 'tegra-for-6.13-firmware' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers
firmware: tegra: Changes for v6.13-rc1 This contains a revert for a patch that I had modified before applying and the author didn't agree with the change. * tag 'tegra-for-6.13-firmware' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: Revert "firmware: tegra: bpmp: Use scoped device node handling to simplify error paths" Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents d1d43fa + 61c6fe3 commit 2570a24

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

drivers/firmware/tegra/bpmp.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
44
*/
55

6-
#include <linux/cleanup.h>
76
#include <linux/clk/tegra.h>
87
#include <linux/genalloc.h>
98
#include <linux/mailbox_client.h>
@@ -35,24 +34,29 @@ channel_to_ops(struct tegra_bpmp_channel *channel)
3534

3635
struct tegra_bpmp *tegra_bpmp_get(struct device *dev)
3736
{
38-
struct device_node *np __free(device_node);
3937
struct platform_device *pdev;
4038
struct tegra_bpmp *bpmp;
39+
struct device_node *np;
4140

4241
np = of_parse_phandle(dev->of_node, "nvidia,bpmp", 0);
4342
if (!np)
4443
return ERR_PTR(-ENOENT);
4544

4645
pdev = of_find_device_by_node(np);
47-
if (!pdev)
48-
return ERR_PTR(-ENODEV);
46+
if (!pdev) {
47+
bpmp = ERR_PTR(-ENODEV);
48+
goto put;
49+
}
4950

5051
bpmp = platform_get_drvdata(pdev);
5152
if (!bpmp) {
53+
bpmp = ERR_PTR(-EPROBE_DEFER);
5254
put_device(&pdev->dev);
53-
return ERR_PTR(-EPROBE_DEFER);
55+
goto put;
5456
}
5557

58+
put:
59+
of_node_put(np);
5660
return bpmp;
5761
}
5862
EXPORT_SYMBOL_GPL(tegra_bpmp_get);

0 commit comments

Comments
 (0)