lkml.org 
[lkml]   [2017]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 2/3] ASoC: codecs: msm8916-analog: support jack detection
On Tue, Jul 25, 2017 at 01:51:25PM -0400, Damien Riegel wrote:

> + for (i = 0; i < ARRAY_SIZE(jack_detect_irqs); i++) {
> + int irq;
> +
> + irq = platform_get_irq_byname(pdev, jack_detect_irqs[i].name);
> + if (irq < 0) {
> + dev_warn(dev, "failed to get irq '%s', jack insertion detection disabled\n",
> + jack_detect_irqs[i].name);
> + break;
> + }
> +
> + ret = devm_request_threaded_irq(dev, irq, NULL,

Don't put the loop in when there's only one IRQ, wait till it's needed.
This is an unusual pattern and it's not clear that just bombing out of
the loop with interrupts half requested is a good idea.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2017-07-26 18:22    [W:1.990 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site