@@ -822,53 +822,48 @@ MODULE_DEVICE_TABLE(of, ti_iodelay_of_match);
822
822
static int ti_iodelay_probe (struct platform_device * pdev )
823
823
{
824
824
struct device * dev = & pdev -> dev ;
825
- struct device_node * np = of_node_get (dev -> of_node );
825
+ struct device_node * np __free ( device_node ) = of_node_get (dev -> of_node );
826
826
struct resource * res ;
827
827
struct ti_iodelay_device * iod ;
828
- int ret = 0 ;
828
+ int ret ;
829
829
830
830
if (!np ) {
831
- ret = - EINVAL ;
832
831
dev_err (dev , "No OF node\n" );
833
- goto exit_out ;
832
+ return - EINVAL ;
834
833
}
835
834
836
835
iod = devm_kzalloc (dev , sizeof (* iod ), GFP_KERNEL );
837
- if (!iod ) {
838
- ret = - ENOMEM ;
839
- goto exit_out ;
840
- }
836
+ if (!iod )
837
+ return - ENOMEM ;
838
+
841
839
iod -> dev = dev ;
842
840
iod -> reg_data = device_get_match_data (dev );
843
841
if (!iod -> reg_data ) {
844
- ret = - EINVAL ;
845
842
dev_err (dev , "No DATA match\n" );
846
- goto exit_out ;
843
+ return - EINVAL ;
847
844
}
848
845
849
846
/* So far We can assume there is only 1 bank of registers */
850
847
iod -> reg_base = devm_platform_get_and_ioremap_resource (pdev , 0 , & res );
851
- if (IS_ERR (iod -> reg_base )) {
852
- ret = PTR_ERR (iod -> reg_base );
853
- goto exit_out ;
854
- }
848
+ if (IS_ERR (iod -> reg_base ))
849
+ return PTR_ERR (iod -> reg_base );
850
+
855
851
iod -> phys_base = res -> start ;
856
852
857
853
iod -> regmap = devm_regmap_init_mmio (dev , iod -> reg_base ,
858
854
iod -> reg_data -> regmap_config );
859
855
if (IS_ERR (iod -> regmap )) {
860
856
dev_err (dev , "Regmap MMIO init failed.\n" );
861
- ret = PTR_ERR (iod -> regmap );
862
- goto exit_out ;
857
+ return PTR_ERR (iod -> regmap );
863
858
}
864
859
865
860
ret = ti_iodelay_pinconf_init_dev (iod );
866
861
if (ret )
867
- goto exit_out ;
862
+ return ret ;
868
863
869
864
ret = ti_iodelay_alloc_pins (dev , iod , res -> start );
870
865
if (ret )
871
- goto exit_out ;
866
+ return ret ;
872
867
873
868
iod -> desc .pctlops = & ti_iodelay_pinctrl_ops ;
874
869
/* no pinmux ops - we are pinconf */
@@ -879,20 +874,12 @@ static int ti_iodelay_probe(struct platform_device *pdev)
879
874
ret = devm_pinctrl_register_and_init (dev , & iod -> desc , iod , & iod -> pctl );
880
875
if (ret ) {
881
876
dev_err (dev , "Failed to register pinctrl\n" );
882
- goto exit_out ;
877
+ return ret ;
883
878
}
884
879
885
880
platform_set_drvdata (pdev , iod );
886
881
887
- ret = pinctrl_enable (iod -> pctl );
888
- if (ret )
889
- goto exit_out ;
890
-
891
- return 0 ;
892
-
893
- exit_out :
894
- of_node_put (np );
895
- return ret ;
882
+ return pinctrl_enable (iod -> pctl );
896
883
}
897
884
898
885
/**
0 commit comments