File tree Expand file tree Collapse file tree 6 files changed +20
-40
lines changed Expand file tree Collapse file tree 6 files changed +20
-40
lines changed Original file line number Diff line number Diff line change @@ -2101,18 +2101,14 @@ static int da7213_probe(struct snd_soc_component *component)
2101
2101
pm_runtime_put_sync (component -> dev );
2102
2102
2103
2103
/* Check if MCLK provided */
2104
- da7213 -> mclk = devm_clk_get (component -> dev , "mclk" );
2105
- if (IS_ERR (da7213 -> mclk )) {
2106
- if (PTR_ERR (da7213 -> mclk ) != - ENOENT )
2107
- return PTR_ERR (da7213 -> mclk );
2108
- else
2109
- da7213 -> mclk = NULL ;
2110
- } else {
2104
+ da7213 -> mclk = devm_clk_get_optional (component -> dev , "mclk" );
2105
+ if (IS_ERR (da7213 -> mclk ))
2106
+ return PTR_ERR (da7213 -> mclk );
2107
+ if (da7213 -> mclk )
2111
2108
/* Do automatic PLL handling assuming fixed clock until
2112
2109
* set_pll() has been called. This makes the codec usable
2113
2110
* with the simple-audio-card driver. */
2114
2111
da7213 -> fixed_clk_auto_pll = true;
2115
- }
2116
2112
2117
2113
/* Default infinite tone gen, start/stop by Kcontrol */
2118
2114
snd_soc_component_write (component , DA7213_TONE_GEN_CYCLES , DA7213_BEEP_CYCLES_MASK );
Original file line number Diff line number Diff line change @@ -2836,16 +2836,12 @@ static int nau8825_read_device_properties(struct device *dev,
2836
2836
if (nau8825 -> adc_delay < 125 || nau8825 -> adc_delay > 500 )
2837
2837
dev_warn (dev , "Please set the suitable delay time!\n" );
2838
2838
2839
- nau8825 -> mclk = devm_clk_get (dev , "mclk" );
2840
- if (PTR_ERR (nau8825 -> mclk ) == - EPROBE_DEFER ) {
2841
- return - EPROBE_DEFER ;
2842
- } else if (PTR_ERR ( nau8825 -> mclk ) == - ENOENT ) {
2839
+ nau8825 -> mclk = devm_clk_get_optional (dev , "mclk" );
2840
+ if (IS_ERR (nau8825 -> mclk ))
2841
+ return PTR_ERR ( nau8825 -> mclk ) ;
2842
+ if (! nau8825 -> mclk )
2843
2843
/* The MCLK is managed externally or not used at all */
2844
- nau8825 -> mclk = NULL ;
2845
2844
dev_info (dev , "No 'mclk' clock found, assume MCLK is managed externally" );
2846
- } else if (IS_ERR (nau8825 -> mclk )) {
2847
- return - EINVAL ;
2848
- }
2849
2845
2850
2846
return 0 ;
2851
2847
}
Original file line number Diff line number Diff line change @@ -1054,9 +1054,6 @@ static int rt5514_set_bias_level(struct snd_soc_component *component,
1054
1054
1055
1055
switch (level ) {
1056
1056
case SND_SOC_BIAS_PREPARE :
1057
- if (IS_ERR (rt5514 -> mclk ))
1058
- break ;
1059
-
1060
1057
if (snd_soc_component_get_bias_level (component ) == SND_SOC_BIAS_ON ) {
1061
1058
clk_disable_unprepare (rt5514 -> mclk );
1062
1059
} else {
@@ -1097,9 +1094,9 @@ static int rt5514_probe(struct snd_soc_component *component)
1097
1094
struct platform_device * pdev = container_of (component -> dev ,
1098
1095
struct platform_device , dev );
1099
1096
1100
- rt5514 -> mclk = devm_clk_get (component -> dev , "mclk" );
1101
- if (PTR_ERR (rt5514 -> mclk ) == - EPROBE_DEFER )
1102
- return - EPROBE_DEFER ;
1097
+ rt5514 -> mclk = devm_clk_get_optional (component -> dev , "mclk" );
1098
+ if (IS_ERR (rt5514 -> mclk ))
1099
+ return PTR_ERR ( rt5514 -> mclk ) ;
1103
1100
1104
1101
if (rt5514 -> pdata .dsp_calib_clk_name ) {
1105
1102
rt5514 -> dsp_calib_clk = devm_clk_get (& pdev -> dev ,
Original file line number Diff line number Diff line change @@ -1174,9 +1174,6 @@ static int rt5616_set_bias_level(struct snd_soc_component *component,
1174
1174
* away from ON. Disable the clock in that case, otherwise
1175
1175
* enable it.
1176
1176
*/
1177
- if (IS_ERR (rt5616 -> mclk ))
1178
- break ;
1179
-
1180
1177
if (snd_soc_component_get_bias_level (component ) == SND_SOC_BIAS_ON ) {
1181
1178
clk_disable_unprepare (rt5616 -> mclk );
1182
1179
} else {
@@ -1225,9 +1222,9 @@ static int rt5616_probe(struct snd_soc_component *component)
1225
1222
struct rt5616_priv * rt5616 = snd_soc_component_get_drvdata (component );
1226
1223
1227
1224
/* Check if MCLK provided */
1228
- rt5616 -> mclk = devm_clk_get (component -> dev , "mclk" );
1229
- if (PTR_ERR (rt5616 -> mclk ) == - EPROBE_DEFER )
1230
- return - EPROBE_DEFER ;
1225
+ rt5616 -> mclk = devm_clk_get_optional (component -> dev , "mclk" );
1226
+ if (IS_ERR (rt5616 -> mclk ))
1227
+ return PTR_ERR ( rt5616 -> mclk ) ;
1231
1228
1232
1229
rt5616 -> component = component ;
1233
1230
Original file line number Diff line number Diff line change @@ -1949,9 +1949,6 @@ static int rt5640_set_bias_level(struct snd_soc_component *component,
1949
1949
* away from ON. Disable the clock in that case, otherwise
1950
1950
* enable it.
1951
1951
*/
1952
- if (IS_ERR (rt5640 -> mclk ))
1953
- break ;
1954
-
1955
1952
if (snd_soc_component_get_bias_level (component ) == SND_SOC_BIAS_ON ) {
1956
1953
clk_disable_unprepare (rt5640 -> mclk );
1957
1954
} else {
@@ -2661,9 +2658,9 @@ static int rt5640_probe(struct snd_soc_component *component)
2661
2658
u32 val ;
2662
2659
2663
2660
/* Check if MCLK provided */
2664
- rt5640 -> mclk = devm_clk_get (component -> dev , "mclk" );
2665
- if (PTR_ERR (rt5640 -> mclk ) == - EPROBE_DEFER )
2666
- return - EPROBE_DEFER ;
2661
+ rt5640 -> mclk = devm_clk_get_optional (component -> dev , "mclk" );
2662
+ if (IS_ERR (rt5640 -> mclk ))
2663
+ return PTR_ERR ( rt5640 -> mclk ) ;
2667
2664
2668
2665
rt5640 -> component = component ;
2669
2666
Original file line number Diff line number Diff line change @@ -1079,9 +1079,6 @@ static int rt5660_set_bias_level(struct snd_soc_component *component,
1079
1079
snd_soc_component_update_bits (component , RT5660_GEN_CTRL1 ,
1080
1080
RT5660_DIG_GATE_CTRL , RT5660_DIG_GATE_CTRL );
1081
1081
1082
- if (IS_ERR (rt5660 -> mclk ))
1083
- break ;
1084
-
1085
1082
if (snd_soc_component_get_bias_level (component ) == SND_SOC_BIAS_ON ) {
1086
1083
clk_disable_unprepare (rt5660 -> mclk );
1087
1084
} else {
@@ -1277,9 +1274,9 @@ static int rt5660_i2c_probe(struct i2c_client *i2c)
1277
1274
return - ENOMEM ;
1278
1275
1279
1276
/* Check if MCLK provided */
1280
- rt5660 -> mclk = devm_clk_get (& i2c -> dev , "mclk" );
1281
- if (PTR_ERR (rt5660 -> mclk ) == - EPROBE_DEFER )
1282
- return - EPROBE_DEFER ;
1277
+ rt5660 -> mclk = devm_clk_get_optional (& i2c -> dev , "mclk" );
1278
+ if (IS_ERR (rt5660 -> mclk ))
1279
+ return PTR_ERR ( rt5660 -> mclk ) ;
1283
1280
1284
1281
i2c_set_clientdata (i2c , rt5660 );
1285
1282
You can’t perform that action at this time.
0 commit comments