lkml.org 
[lkml]   [2022]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.15 216/530] ASoC: mt6359: fix tests for platform_get_irq() failure
    Date
    From: Dan Carpenter <dan.carpenter@oracle.com>

    [ Upstream commit 51eea3a6fb4d39c2cc71824e6eee5949d7ae4d1c ]

    The platform_get_irq() returns negative error codes. It can't actually
    return zero, but if it did that should be treated as success.

    Fixes: eef07b9e0925 ("ASoC: mediatek: mt6359: add MT6359 accdet jack driver")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Link: https://lore.kernel.org/r/YvThhr86N3qQM2EO@kili
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    sound/soc/codecs/mt6359-accdet.c | 6 +++---
    1 file changed, 3 insertions(+), 3 deletions(-)

    diff --git a/sound/soc/codecs/mt6359-accdet.c b/sound/soc/codecs/mt6359-accdet.c
    index c190628e2905..7f624854948c 100644
    --- a/sound/soc/codecs/mt6359-accdet.c
    +++ b/sound/soc/codecs/mt6359-accdet.c
    @@ -965,7 +965,7 @@ static int mt6359_accdet_probe(struct platform_device *pdev)
    mutex_init(&priv->res_lock);

    priv->accdet_irq = platform_get_irq(pdev, 0);
    - if (priv->accdet_irq) {
    + if (priv->accdet_irq >= 0) {
    ret = devm_request_threaded_irq(&pdev->dev, priv->accdet_irq,
    NULL, mt6359_accdet_irq,
    IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
    @@ -979,7 +979,7 @@ static int mt6359_accdet_probe(struct platform_device *pdev)

    if (priv->caps & ACCDET_PMIC_EINT0) {
    priv->accdet_eint0 = platform_get_irq(pdev, 1);
    - if (priv->accdet_eint0) {
    + if (priv->accdet_eint0 >= 0) {
    ret = devm_request_threaded_irq(&pdev->dev,
    priv->accdet_eint0,
    NULL, mt6359_accdet_irq,
    @@ -994,7 +994,7 @@ static int mt6359_accdet_probe(struct platform_device *pdev)
    }
    } else if (priv->caps & ACCDET_PMIC_EINT1) {
    priv->accdet_eint1 = platform_get_irq(pdev, 2);
    - if (priv->accdet_eint1) {
    + if (priv->accdet_eint1 >= 0) {
    ret = devm_request_threaded_irq(&pdev->dev,
    priv->accdet_eint1,
    NULL, mt6359_accdet_irq,
    --
    2.35.1


    \
     
     \ /
      Last update: 2022-10-24 18:51    [W:5.745 / U:0.088 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site