File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 3
3
* Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
4
4
*/
5
5
6
- #include <linux/cleanup.h>
7
6
#include <linux/clk/tegra.h>
8
7
#include <linux/genalloc.h>
9
8
#include <linux/mailbox_client.h>
@@ -35,24 +34,29 @@ channel_to_ops(struct tegra_bpmp_channel *channel)
35
34
36
35
struct tegra_bpmp * tegra_bpmp_get (struct device * dev )
37
36
{
38
- struct device_node * np __free (device_node );
39
37
struct platform_device * pdev ;
40
38
struct tegra_bpmp * bpmp ;
39
+ struct device_node * np ;
41
40
42
41
np = of_parse_phandle (dev -> of_node , "nvidia,bpmp" , 0 );
43
42
if (!np )
44
43
return ERR_PTR (- ENOENT );
45
44
46
45
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
+ }
49
50
50
51
bpmp = platform_get_drvdata (pdev );
51
52
if (!bpmp ) {
53
+ bpmp = ERR_PTR (- EPROBE_DEFER );
52
54
put_device (& pdev -> dev );
53
- return ERR_PTR ( - EPROBE_DEFER ) ;
55
+ goto put ;
54
56
}
55
57
58
+ put :
59
+ of_node_put (np );
56
60
return bpmp ;
57
61
}
58
62
EXPORT_SYMBOL_GPL (tegra_bpmp_get );
You can’t perform that action at this time.
0 commit comments