Thread (16 messages) 16 messages, 5 authors, 2015-07-02

[PATCH V2 4/5] drivers/rtc/rtc-ds1307.c: Support optional wakeup interrupt source

From: grygorii.strashko@ti.com (Grygorii Strashko)
Date: 2015-06-24 16:26:14
Also in: linux-omap, linux-rtc, lkml

On 06/24/2015 07:07 PM, Nishanth Menon wrote:
On 06/24/2015 10:36 AM, Grygorii Strashko wrote:
quoted
On 06/23/2015 07:15 PM, Nishanth Menon wrote:
[...]
quoted
quoted
+		ds1307->wakeirq = of_irq_get(node, 1);
+		if (ds1307->wakeirq <= 0) {
+			if (ds1307->wakeirq == -EPROBE_DEFER) {
+				err = ds1307->wakeirq;
+				goto exit;
+			}
+			ds1307->wakeirq = 0;
+			goto no_irq;
+		}
Might be above code could be done a little bit simpler?

		err = of_irq_get(node, 1);
		if (err <= 0) {
			if (err == -EPROBE_DEFER)
				goto exit;
			goto no_irq;
I had considered it, but problem with this approach is that is err
does not get reset back to 0 and probe will fail as it flows through
the rest of the code.. which is not our intent.
quoted
		}
		ds1307->wakeirq = err;
As I can see from final code (after applying all patches) - It should work.
But I will not insist :)

-- 
regards,
-grygorii
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help