File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -455,7 +455,6 @@ static int imx_gpc_probe(struct platform_device *pdev)
455
455
} else {
456
456
struct imx_pm_domain * domain ;
457
457
struct platform_device * pd_pdev ;
458
- struct device_node * np ;
459
458
struct clk * ipg_clk ;
460
459
unsigned int ipg_rate_mhz ;
461
460
int domain_index ;
@@ -465,28 +464,24 @@ static int imx_gpc_probe(struct platform_device *pdev)
465
464
return PTR_ERR (ipg_clk );
466
465
ipg_rate_mhz = clk_get_rate (ipg_clk ) / 1000000 ;
467
466
468
- for_each_child_of_node (pgc_node , np ) {
467
+ for_each_child_of_node_scoped (pgc_node , np ) {
469
468
ret = of_property_read_u32 (np , "reg" , & domain_index );
470
- if (ret ) {
471
- of_node_put (np );
469
+ if (ret )
472
470
return ret ;
473
- }
471
+
474
472
if (domain_index >= of_id_data -> num_domains )
475
473
continue ;
476
474
477
475
pd_pdev = platform_device_alloc ("imx-pgc-power-domain" ,
478
476
domain_index );
479
- if (!pd_pdev ) {
480
- of_node_put (np );
477
+ if (!pd_pdev )
481
478
return - ENOMEM ;
482
- }
483
479
484
480
ret = platform_device_add_data (pd_pdev ,
485
481
& imx_gpc_domains [domain_index ],
486
482
sizeof (imx_gpc_domains [domain_index ]));
487
483
if (ret ) {
488
484
platform_device_put (pd_pdev );
489
- of_node_put (np );
490
485
return ret ;
491
486
}
492
487
domain = pd_pdev -> dev .platform_data ;
@@ -500,7 +495,6 @@ static int imx_gpc_probe(struct platform_device *pdev)
500
495
ret = platform_device_add (pd_pdev );
501
496
if (ret ) {
502
497
platform_device_put (pd_pdev );
503
- of_node_put (np );
504
498
return ret ;
505
499
}
506
500
}
You can’t perform that action at this time.
0 commit comments