Patch "ASoC: tlv320adcx140: fix 'ti,gpio-config' DT property init" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ASoC: tlv320adcx140: fix 'ti,gpio-config' DT property init

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     asoc-tlv320adcx140-fix-ti-gpio-config-dt-property-in.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d7c84c6c960d5a24253d47dfdf7f52fefbf71c3c
Author: Steffen Aschbacher <steffen.aschbacher@xxxxxxxx>
Date:   Mon Feb 13 09:38:05 2023 +0200

    ASoC: tlv320adcx140: fix 'ti,gpio-config' DT property init
    
    [ Upstream commit 771725efe5e2e5396dd9d1220437e5f9d6b9ca9d ]
    
    When the 'ti,gpio-config' property is not defined, the
    device_property_count_u32() will return an error, rather than zero.
    
    The current check, only handles a return value of zero, which assumes that
    the property is defined and has nothing defined.
    
    This change extends the check to also check for an error case (most likely
    to be hit by the case that the 'ti,gpio-config' is not defined).
    
    In case that the 'ti,gpio-config' and the returned 'gpio_count' is not
    correct, there is a 'if (gpio_count != ADCX140_NUM_GPIO_CFGS)' check, a few
    lines lower that will return -EINVAL.
    This means that someone tried to define 'ti,gpio-config', but with the
    wrong number of GPIOs.
    
    Fixes: d5214321498a ("ASoC: tlv320adcx140: Add support for configuring GPIO pin")
    Signed-off-by: Steffen Aschbacher <steffen.aschbacher@xxxxxxxx>
    Signed-off-by: Alexandru Ardelean <alex@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230213073805.14640-1-alex@xxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx140.c
index 32b120d624b25..06d2502b13478 100644
--- a/sound/soc/codecs/tlv320adcx140.c
+++ b/sound/soc/codecs/tlv320adcx140.c
@@ -870,7 +870,7 @@ static int adcx140_configure_gpio(struct adcx140_priv *adcx140)
 
 	gpio_count = device_property_count_u32(adcx140->dev,
 			"ti,gpio-config");
-	if (gpio_count == 0)
+	if (gpio_count <= 0)
 		return 0;
 
 	if (gpio_count != ADCX140_NUM_GPIO_CFGS)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux