Merge 99ddc1491b ("ASoC: codecs: wm0010: Fix error handling path in wm0010_spi_probe()") into android14-6.1-lts

Steps on the way to 6.1.132

Change-Id: If8184688e643a49c75fddc490c23dd0673a393d5
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2025-04-15 17:16:26 +00:00
5 changed files with 32 additions and 22 deletions

View File

@@ -279,6 +279,11 @@ static void mid_get_vbt_data(struct drm_psb_private *dev_priv)
0, PCI_DEVFN(2, 0));
int ret = -1;
if (pci_gfx_root == NULL) {
WARN_ON(1);
return;
}
/* Get the address of the platform config vbt */
pci_read_config_dword(pci_gfx_root, 0xFC, &addr);
pci_dev_put(pci_gfx_root);

View File

@@ -258,6 +258,7 @@ static int mlxreg_led_probe(struct platform_device *pdev)
{
struct mlxreg_core_platform_data *led_pdata;
struct mlxreg_led_priv_data *priv;
int err;
led_pdata = dev_get_platdata(&pdev->dev);
if (!led_pdata) {
@@ -269,28 +270,21 @@ static int mlxreg_led_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
mutex_init(&priv->access_lock);
err = devm_mutex_init(&pdev->dev, &priv->access_lock);
if (err)
return err;
priv->pdev = pdev;
priv->pdata = led_pdata;
return mlxreg_led_config(priv);
}
static int mlxreg_led_remove(struct platform_device *pdev)
{
struct mlxreg_led_priv_data *priv = dev_get_drvdata(&pdev->dev);
mutex_destroy(&priv->access_lock);
return 0;
}
static struct platform_driver mlxreg_led_driver = {
.driver = {
.name = "leds-mlxreg",
},
.probe = mlxreg_led_probe,
.remove = mlxreg_led_remove,
};
module_platform_driver(mlxreg_led_driver);

View File

@@ -1151,7 +1151,10 @@ void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd);
/* mixer control */
struct soc_mixer_control {
int min, max, platform_max;
/* Minimum and maximum specified as written to the hardware */
int min, max;
/* Limited maximum value specified as presented through the control */
int platform_max;
int reg, rreg;
unsigned int shift, rshift;
unsigned int sign_bit;

View File

@@ -951,7 +951,7 @@ static int wm0010_spi_probe(struct spi_device *spi)
if (ret) {
dev_err(wm0010->dev, "Failed to set IRQ %d as wake source: %d\n",
irq, ret);
return ret;
goto free_irq;
}
if (spi->max_speed_hz)
@@ -963,9 +963,18 @@ static int wm0010_spi_probe(struct spi_device *spi)
&soc_component_dev_wm0010, wm0010_dai,
ARRAY_SIZE(wm0010_dai));
if (ret < 0)
return ret;
goto disable_irq_wake;
return 0;
disable_irq_wake:
irq_set_irq_wake(wm0010->irq, 0);
free_irq:
if (wm0010->irq)
free_irq(wm0010->irq, wm0010);
return ret;
}
static void wm0010_spi_remove(struct spi_device *spi)

View File

@@ -336,7 +336,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
if (ucontrol->value.integer.value[0] < 0)
return -EINVAL;
val = ucontrol->value.integer.value[0];
if (mc->platform_max && ((int)val + min) > mc->platform_max)
if (mc->platform_max && val > mc->platform_max)
return -EINVAL;
if (val > max - min)
return -EINVAL;
@@ -349,7 +349,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
if (ucontrol->value.integer.value[1] < 0)
return -EINVAL;
val2 = ucontrol->value.integer.value[1];
if (mc->platform_max && ((int)val2 + min) > mc->platform_max)
if (mc->platform_max && val2 > mc->platform_max)
return -EINVAL;
if (val2 > max - min)
return -EINVAL;
@@ -502,17 +502,16 @@ int snd_soc_info_volsw_range(struct snd_kcontrol *kcontrol,
{
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
int platform_max;
int min = mc->min;
int max;
if (!mc->platform_max)
mc->platform_max = mc->max;
platform_max = mc->platform_max;
max = mc->max - mc->min;
if (mc->platform_max && mc->platform_max < max)
max = mc->platform_max;
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = snd_soc_volsw_is_stereo(mc) ? 2 : 1;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = platform_max - min;
uinfo->value.integer.max = max;
return 0;
}