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)
455455 } else {
456456 struct imx_pm_domain * domain ;
457457 struct platform_device * pd_pdev ;
458- struct device_node * np ;
459458 struct clk * ipg_clk ;
460459 unsigned int ipg_rate_mhz ;
461460 int domain_index ;
@@ -465,28 +464,24 @@ static int imx_gpc_probe(struct platform_device *pdev)
465464 return PTR_ERR (ipg_clk );
466465 ipg_rate_mhz = clk_get_rate (ipg_clk ) / 1000000 ;
467466
468- for_each_child_of_node (pgc_node , np ) {
467+ for_each_child_of_node_scoped (pgc_node , np ) {
469468 ret = of_property_read_u32 (np , "reg" , & domain_index );
470- if (ret ) {
471- of_node_put (np );
469+ if (ret )
472470 return ret ;
473- }
471+
474472 if (domain_index >= of_id_data -> num_domains )
475473 continue ;
476474
477475 pd_pdev = platform_device_alloc ("imx-pgc-power-domain" ,
478476 domain_index );
479- if (!pd_pdev ) {
480- of_node_put (np );
477+ if (!pd_pdev )
481478 return - ENOMEM ;
482- }
483479
484480 ret = platform_device_add_data (pd_pdev ,
485481 & imx_gpc_domains [domain_index ],
486482 sizeof (imx_gpc_domains [domain_index ]));
487483 if (ret ) {
488484 platform_device_put (pd_pdev );
489- of_node_put (np );
490485 return ret ;
491486 }
492487 domain = pd_pdev -> dev .platform_data ;
@@ -500,7 +495,6 @@ static int imx_gpc_probe(struct platform_device *pdev)
500495 ret = platform_device_add (pd_pdev );
501496 if (ret ) {
502497 platform_device_put (pd_pdev );
503- of_node_put (np );
504498 return ret ;
505499 }
506500 }
You can’t perform that action at this time.
0 commit comments