@@ -3803,11 +3803,14 @@ static int rx_macro_probe(struct platform_device *pdev)
3803
3803
if (IS_ERR (rx -> pds ))
3804
3804
return PTR_ERR (rx -> pds );
3805
3805
3806
+ ret = devm_add_action_or_reset (dev , lpass_macro_pds_exit_action , rx -> pds );
3807
+ if (ret )
3808
+ return ret ;
3809
+
3806
3810
base = devm_platform_ioremap_resource (pdev , 0 );
3807
- if (IS_ERR (base )) {
3808
- ret = PTR_ERR (base );
3809
- goto err ;
3810
- }
3811
+ if (IS_ERR (base ))
3812
+ return PTR_ERR (base );
3813
+
3811
3814
rx -> codec_version = lpass_macro_get_codec_version ();
3812
3815
switch (rx -> codec_version ) {
3813
3816
case LPASS_CODEC_VERSION_1_0 :
@@ -3818,10 +3821,8 @@ static int rx_macro_probe(struct platform_device *pdev)
3818
3821
rx -> rxn_reg_stride = 0x80 ;
3819
3822
def_count = ARRAY_SIZE (rx_defaults ) + ARRAY_SIZE (rx_pre_2_5_defaults );
3820
3823
reg_defaults = kmalloc_array (def_count , sizeof (struct reg_default ), GFP_KERNEL );
3821
- if (!reg_defaults ) {
3822
- ret = - ENOMEM ;
3823
- goto err ;
3824
- }
3824
+ if (!reg_defaults )
3825
+ return - ENOMEM ;
3825
3826
memcpy (& reg_defaults [0 ], rx_defaults , sizeof (rx_defaults ));
3826
3827
memcpy (& reg_defaults [ARRAY_SIZE (rx_defaults )],
3827
3828
rx_pre_2_5_defaults , sizeof (rx_pre_2_5_defaults ));
@@ -3833,18 +3834,15 @@ static int rx_macro_probe(struct platform_device *pdev)
3833
3834
rx -> rxn_reg_stride = 0xc0 ;
3834
3835
def_count = ARRAY_SIZE (rx_defaults ) + ARRAY_SIZE (rx_2_5_defaults );
3835
3836
reg_defaults = kmalloc_array (def_count , sizeof (struct reg_default ), GFP_KERNEL );
3836
- if (!reg_defaults ) {
3837
- ret = - ENOMEM ;
3838
- goto err ;
3839
- }
3837
+ if (!reg_defaults )
3838
+ return - ENOMEM ;
3840
3839
memcpy (& reg_defaults [0 ], rx_defaults , sizeof (rx_defaults ));
3841
3840
memcpy (& reg_defaults [ARRAY_SIZE (rx_defaults )],
3842
3841
rx_2_5_defaults , sizeof (rx_2_5_defaults ));
3843
3842
break ;
3844
3843
default :
3845
3844
dev_err (dev , "Unsupported Codec version (%d)\n" , rx -> codec_version );
3846
- ret = - EINVAL ;
3847
- goto err ;
3845
+ return - EINVAL ;
3848
3846
}
3849
3847
3850
3848
rx_regmap_config .reg_defaults = reg_defaults ;
@@ -3927,8 +3925,6 @@ static int rx_macro_probe(struct platform_device *pdev)
3927
3925
clk_disable_unprepare (rx -> macro );
3928
3926
err_ver :
3929
3927
kfree (reg_defaults );
3930
- err :
3931
- lpass_macro_pds_exit (rx -> pds );
3932
3928
3933
3929
return ret ;
3934
3930
}
@@ -3942,8 +3938,6 @@ static void rx_macro_remove(struct platform_device *pdev)
3942
3938
clk_disable_unprepare (rx -> fsgen );
3943
3939
clk_disable_unprepare (rx -> macro );
3944
3940
clk_disable_unprepare (rx -> dcodec );
3945
-
3946
- lpass_macro_pds_exit (rx -> pds );
3947
3941
}
3948
3942
3949
3943
static const struct of_device_id rx_macro_dt_match [] = {
0 commit comments