@@ -751,11 +751,11 @@ static int brcm_sata_phy_probe(struct platform_device *pdev)
751
751
{
752
752
const char * rxaeq_mode ;
753
753
struct device * dev = & pdev -> dev ;
754
- struct device_node * dn = dev -> of_node , * child ;
754
+ struct device_node * dn = dev -> of_node ;
755
755
const struct of_device_id * of_id ;
756
756
struct brcm_sata_phy * priv ;
757
757
struct phy_provider * provider ;
758
- int ret , count = 0 ;
758
+ int count = 0 ;
759
759
760
760
if (of_get_child_count (dn ) == 0 )
761
761
return - ENODEV ;
@@ -782,26 +782,23 @@ static int brcm_sata_phy_probe(struct platform_device *pdev)
782
782
return PTR_ERR (priv -> ctrl_base );
783
783
}
784
784
785
- for_each_available_child_of_node (dn , child ) {
785
+ for_each_available_child_of_node_scoped (dn , child ) {
786
786
unsigned int id ;
787
787
struct brcm_sata_port * port ;
788
788
789
789
if (of_property_read_u32 (child , "reg" , & id )) {
790
790
dev_err (dev , "missing reg property in node %pOFn\n" ,
791
791
child );
792
- ret = - EINVAL ;
793
- goto put_child ;
792
+ return - EINVAL ;
794
793
}
795
794
796
795
if (id >= MAX_PORTS ) {
797
796
dev_err (dev , "invalid reg: %u\n" , id );
798
- ret = - EINVAL ;
799
- goto put_child ;
797
+ return - EINVAL ;
800
798
}
801
799
if (priv -> phys [id ].phy ) {
802
800
dev_err (dev , "already registered port %u\n" , id );
803
- ret = - EINVAL ;
804
- goto put_child ;
801
+ return - EINVAL ;
805
802
}
806
803
807
804
port = & priv -> phys [id ];
@@ -822,8 +819,7 @@ static int brcm_sata_phy_probe(struct platform_device *pdev)
822
819
port -> ssc_en = of_property_read_bool (child , "brcm,enable-ssc" );
823
820
if (IS_ERR (port -> phy )) {
824
821
dev_err (dev , "failed to create PHY\n" );
825
- ret = PTR_ERR (port -> phy );
826
- goto put_child ;
822
+ return PTR_ERR (port -> phy );
827
823
}
828
824
829
825
phy_set_drvdata (port -> phy , port );
@@ -839,9 +835,6 @@ static int brcm_sata_phy_probe(struct platform_device *pdev)
839
835
dev_info (dev , "registered %d port(s)\n" , count );
840
836
841
837
return 0 ;
842
- put_child :
843
- of_node_put (child );
844
- return ret ;
845
838
}
846
839
847
840
static struct platform_driver brcm_sata_phy_driver = {
0 commit comments