Skip to content

Commit 61c6fe3

Browse files
krzkthierryreding
authored andcommitted
Revert "firmware: tegra: bpmp: Use scoped device node handling to simplify error paths"
This reverts commit 8812b86 ("firmware: tegra: bpmp: Use scoped device node handling to simplify error paths") because it was silently modified by committer during commit process, by moving declaration of 'struct device_node *np' above the initializer/constructor. Such code was not intention of the author, is not conforming to cleanup.h code style and decreases the code readability. I did not write such code and I did not agree to put my name with such commit. Original patch: https://lore.kernel.org/all/[email protected]/ Cc: Arnd Bergmann <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> [[email protected]: shorten subject line] Signed-off-by: Thierry Reding <[email protected]>
1 parent 9852d85 commit 61c6fe3

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)