Skip to content

Commit 10043bb

Browse files
broonietiwai
authored andcommitted
ASoC: rt5645: Avoid upgrading static warnings to errors
One of the fixes reverted as part of the UMN fallout was actually fine, however rather than undoing the revert the process that handled all this stuff resulted in a patch which attempted to add extra error checks instead. Unfortunately this new change wasn't really based on a good understanding of the subsystem APIs and bypassed the usual patch flow without ensuring it was reviewed by people with subsystem knowledge and was merged as a fix rather than during the merge window. The effect of the new fix is to upgrade what were previously warnings on static data in the code to hard errors on that data. If this actually happens then it would break existing systems, if it doesn't happen then the change has no effect so this was not a safe change to apply as a fix to the release candidates. Since the new code has not been tested and doesn't in practice improve error handling revert it instead, and also drop the original revert since the original fix was fine. This takes the driver back to what it was in -rc1. Fixes: 5e70b8e ("ASoC: rt5645: add error checking to rt5645_probe function") Fixes: 1e0ce84 ("Revert "ASoC: rt5645: fix a NULL pointer dereference") Signed-off-by: Mark Brown <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Phillip Potter <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]> (cherry picked from commit 916cccb) Signed-off-by: Takashi Iwai <[email protected]>
1 parent 13311e7 commit 10043bb

File tree

1 file changed

+11
-38
lines changed

1 file changed

+11
-38
lines changed

sound/soc/codecs/rt5645.c

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3388,62 +3388,40 @@ static int rt5645_probe(struct snd_soc_component *component)
33883388
{
33893389
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
33903390
struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
3391-
int ret = 0;
33923391

33933392
rt5645->component = component;
33943393

33953394
switch (rt5645->codec_type) {
33963395
case CODEC_TYPE_RT5645:
3397-
ret = snd_soc_dapm_new_controls(dapm,
3396+
snd_soc_dapm_new_controls(dapm,
33983397
rt5645_specific_dapm_widgets,
33993398
ARRAY_SIZE(rt5645_specific_dapm_widgets));
3400-
if (ret < 0)
3401-
goto exit;
3402-
3403-
ret = snd_soc_dapm_add_routes(dapm,
3399+
snd_soc_dapm_add_routes(dapm,
34043400
rt5645_specific_dapm_routes,
34053401
ARRAY_SIZE(rt5645_specific_dapm_routes));
3406-
if (ret < 0)
3407-
goto exit;
3408-
34093402
if (rt5645->v_id < 3) {
3410-
ret = snd_soc_dapm_add_routes(dapm,
3403+
snd_soc_dapm_add_routes(dapm,
34113404
rt5645_old_dapm_routes,
34123405
ARRAY_SIZE(rt5645_old_dapm_routes));
3413-
if (ret < 0)
3414-
goto exit;
34153406
}
34163407
break;
34173408
case CODEC_TYPE_RT5650:
3418-
ret = snd_soc_dapm_new_controls(dapm,
3409+
snd_soc_dapm_new_controls(dapm,
34193410
rt5650_specific_dapm_widgets,
34203411
ARRAY_SIZE(rt5650_specific_dapm_widgets));
3421-
if (ret < 0)
3422-
goto exit;
3423-
3424-
ret = snd_soc_dapm_add_routes(dapm,
3412+
snd_soc_dapm_add_routes(dapm,
34253413
rt5650_specific_dapm_routes,
34263414
ARRAY_SIZE(rt5650_specific_dapm_routes));
3427-
if (ret < 0)
3428-
goto exit;
34293415
break;
34303416
}
34313417

34323418
snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF);
34333419

34343420
/* for JD function */
34353421
if (rt5645->pdata.jd_mode) {
3436-
ret = snd_soc_dapm_force_enable_pin(dapm, "JD Power");
3437-
if (ret < 0)
3438-
goto exit;
3439-
3440-
ret = snd_soc_dapm_force_enable_pin(dapm, "LDO2");
3441-
if (ret < 0)
3442-
goto exit;
3443-
3444-
ret = snd_soc_dapm_sync(dapm);
3445-
if (ret < 0)
3446-
goto exit;
3422+
snd_soc_dapm_force_enable_pin(dapm, "JD Power");
3423+
snd_soc_dapm_force_enable_pin(dapm, "LDO2");
3424+
snd_soc_dapm_sync(dapm);
34473425
}
34483426

34493427
if (rt5645->pdata.long_name)
@@ -3454,14 +3432,9 @@ static int rt5645_probe(struct snd_soc_component *component)
34543432
GFP_KERNEL);
34553433

34563434
if (!rt5645->eq_param)
3457-
ret = -ENOMEM;
3458-
exit:
3459-
/*
3460-
* If there was an error above, everything will be cleaned up by the
3461-
* caller if we return an error here. This will be done with a later
3462-
* call to rt5645_remove().
3463-
*/
3464-
return ret;
3435+
return -ENOMEM;
3436+
3437+
return 0;
34653438
}
34663439

34673440
static void rt5645_remove(struct snd_soc_component *component)

0 commit comments

Comments
 (0)