Skip to content

Commit

Permalink
iio: exynos-adc: request second interupt only when touchscreen mode i…
Browse files Browse the repository at this point in the history
…s used

commit 865b080 upstream.

Second interrupt is needed only when touchscreen mode is used, so don't
request it unconditionally. This removes the following annoying warning
during boot:

exynos-adc 14d10000.adc: error -ENXIO: IRQ index 1 not found

Fixes: 2bb8ad9 ("iio: exynos-adc: add experimental touchscreen support")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20231009101412.916922-1-m.szyprowski@samsung.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
mszyprow authored and gregkh committed Nov 2, 2023
1 parent 0a9bb3f commit f2bd3c0
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions drivers/iio/adc/exynos_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,16 +826,26 @@ static int exynos_adc_probe(struct platform_device *pdev)
}
}

/* leave out any TS related code if unreachable */
if (IS_REACHABLE(CONFIG_INPUT)) {
has_ts = of_property_read_bool(pdev->dev.of_node,
"has-touchscreen") || pdata;
}

irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;
info->irq = irq;

irq = platform_get_irq(pdev, 1);
if (irq == -EPROBE_DEFER)
return irq;
if (has_ts) {
irq = platform_get_irq(pdev, 1);
if (irq == -EPROBE_DEFER)
return irq;

info->tsirq = irq;
info->tsirq = irq;
} else {
info->tsirq = -1;
}

info->dev = &pdev->dev;

Expand Down Expand Up @@ -900,12 +910,6 @@ static int exynos_adc_probe(struct platform_device *pdev)
if (info->data->init_hw)
info->data->init_hw(info);

/* leave out any TS related code if unreachable */
if (IS_REACHABLE(CONFIG_INPUT)) {
has_ts = of_property_read_bool(pdev->dev.of_node,
"has-touchscreen") || pdata;
}

if (pdata)
info->delay = pdata->delay;
else
Expand Down

0 comments on commit f2bd3c0

Please sign in to comment.