Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753732AbbGXTPT (ORCPT ); Fri, 24 Jul 2015 15:15:19 -0400 Received: from mail-yk0-f177.google.com ([209.85.160.177]:36843 "EHLO mail-yk0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750975AbbGXTPR (ORCPT ); Fri, 24 Jul 2015 15:15:17 -0400 MIME-Version: 1.0 In-Reply-To: <20150724182655.GA22007@dtor-ws> References: <20150724182655.GA22007@dtor-ws> From: Rob Herring Date: Fri, 24 Jul 2015 14:14:57 -0500 Message-ID: Subject: Re: [PATCH] of/irq: introduce of_has_named_irqs helper To: Dmitry Torokhov Cc: Grant Likely , Rob Herring , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1187 Lines: 33 On Fri, Jul 24, 2015 at 1:26 PM, Dmitry Torokhov wrote: > Sometimes drivers might wish to transition from index-based to named > interrupt descriptions. To aid in decision-making when parsing device > tree data let's provide a helper that will indicate the scheme that is > being used. Generally, IRQs are retrieved by platform_get_irq or platform_get_irq_byname. Drivers should not call the of_irq_* functions directly in most cases. > > Signed-off-by: Dmitry Torokhov > --- > > The intent is to it like this: > > if (of_has_named_irqs(np) { > /* Wake IRQ is optional */ > dev->wakeirq = of_irq_get_byname(np, "wakeup"); > if (dev->wakeirq < 0 && dev->wakeirq != -ENODATA) > return dev->wakeirq; > } of_irq_get_byname will already return an error if the property is not present. Use that. Rob -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/