From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AB52C433ED for ; Thu, 29 Apr 2021 08:58:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BC5826143D for ; Thu, 29 Apr 2021 08:58:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232924AbhD2I7m (ORCPT ); Thu, 29 Apr 2021 04:59:42 -0400 Received: from www381.your-server.de ([78.46.137.84]:53950 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232714AbhD2I7l (ORCPT ); Thu, 29 Apr 2021 04:59:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metafoo.de; s=default2002; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=wkI6VedDBhz3elMdASecoXfk2atYi4oo78R8rslH5Gg=; b=B8kfdHQfwdcgOTXwbHnHpFnHc3 hPGZXTOmeX3AEe5RpdKJfeqac/SjEsSCyQzyj555BNavwlGMicAOywKqC13LrwCitazWNqk7itYZk Caf9Yp7W3vmruBDUbSPU/6tizq3RsP0eOuq6Vk7DV4BA7Oi5xueF/vKO6zdbKfYobpS4S3E5BLQxK jkaZ4XTBXxxCQFudxCGDQJXs5/j/pF8SJtxbO4Pq6qWHkPE2gnyaH8nQeUUkmvhQK9ndDM73HpE0S mvXwAwuCZ3BnIYCr542kRcZ6Tl1sQNGq008cWuA0zWi7K1rI87Yz3gRqiC0U7Hfksp2BwgF0ILxYh 1BmpFPVA==; Received: from sslproxy06.your-server.de ([78.46.172.3]) by www381.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lc2VY-0006nY-1z; Thu, 29 Apr 2021 10:58:52 +0200 Received: from [2001:a61:2bd3:3c01:9e5c:8eff:fe01:8578] by sslproxy06.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lc2VX-000KsX-M6; Thu, 29 Apr 2021 10:58:51 +0200 Subject: Re: [RFC PATCH 2/4] iio: accel: fxls8962af: add interrupt support To: Sean Nyekjaer , jic23@kernel.org, linux-iio@vger.kernel.org, andy.shevchenko@gmail.com, Nuno.Sa@analog.com, robh+dt@kernel.org, devicetree@vger.kernel.org References: <20210428082203.3587022-1-sean@geanix.com> <20210428082203.3587022-2-sean@geanix.com> From: Lars-Peter Clausen Message-ID: <28f1e2a4-b2fa-5e4a-954f-92d90966eaf7@metafoo.de> Date: Thu, 29 Apr 2021 10:58:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <20210428082203.3587022-2-sean@geanix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.103.2/26154/Wed Apr 28 13:07:51 2021) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 4/28/21 10:22 AM, Sean Nyekjaer wrote: > Preparation commit for the next that adds hw buffered sampling > > Signed-off-by: Sean Nyekjaer > --- > [...] > > +static void fxls8962af_get_irq(struct device_node *of_node, enum fxls8962af_int_pin *pin) > +{ > + int irq; > + > + irq = of_irq_get_byname(of_node, "INT2"); For this I'd use device_property_match_string(dev, "interrupt-names", "INT2"). Means it won't try to map the interrupt again, and also this is the only place where the driver directly depends on OF, everything else already uses the device_ API. > + if (irq > 0) { > + *pin = FXLS8962AF_PIN_INT2; > + return; > + } > + > + *pin = FXLS8962AF_PIN_INT1; > +}