Message ID | 20230310144710.1543139-1-robh@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp950761wrd; Fri, 10 Mar 2023 07:59:13 -0800 (PST) X-Google-Smtp-Source: AK7set+dh3X965+7OJLyCwh5q/j8uebub2e1aBRAVGBgkJ+5okntIy2yGypjhoJfNS4uG2H9oGjm X-Received: by 2002:a05:6a20:8b85:b0:cc:50a9:89c0 with SMTP id m5-20020a056a208b8500b000cc50a989c0mr21752891pzh.60.1678463952894; Fri, 10 Mar 2023 07:59:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678463952; cv=none; d=google.com; s=arc-20160816; b=lW8MMQ7OljC2WfMxFU531/AEPZlV8YYQBf+99SSJZkz6d2lqqYkwBB1qzUf2POxLYd ariVgOjNelRQjkFq/bf0NRU5+OQ71FTnhBrTzRr9EEvImW6xUBORc3BoXAKW5GR1xxtg 8k1Ea9tggb6mn4HxkudippU8/FD5pd5DzABQA1t4ba921qz3PAmXl5rsPh2SDfVp9ScT lxfMy5r7sa3q3fDYTKRjR0WEk4gh/3aKbBM8a/mQYL1bZrhV2zcDMV68t4H6/J5tJAKH H+qHN84zBVQmd1nSp3iRmTG/3kPzlYyfh0+MAOvHkN7nJq1P9YLR9xbY76hRt/sLnIyT Gqug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=sFM9cFx4I6hD+gj1NVqX4d9hN+nz0rkv2y+gyZLkCvI=; b=CJVVFWzbf8+/lBRyrHguE6uLcE/VeU36JnR+QJOU+Ai393Owu4+VtpTAhkWstgUtxP GY3KMlE9jEh2ZcEmk3qm1ougUGlUo0PeziwefZPfXhJo10AW2RrYktOPG3TJsBLn0Q/v Dp+A/2+N5KXMIyzqwVqVC0Zs6ddZJxpfDhIFxiHrNJhYU7f/z8+d6opjnNv2ctlmMb6S PeQLr4fzf6cTlbraL5dF6T82tE6Si3kU/y70VyVKp+IRArcycscFwVJi9O2jjnmYp4m/ FImU/qe2mx5RfwdZEVjITiYqCgZfuZLVU71+psO1vmHpUAG7xeA6bxnbzH/K9MpVRQ+W tUUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a63e210000000b004fbc2116e0esi142996pgh.205.2023.03.10.07.58.58; Fri, 10 Mar 2023 07:59:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233200AbjCJOuN (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Fri, 10 Mar 2023 09:50:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233187AbjCJOsj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 10 Mar 2023 09:48:39 -0500 Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D1BD11CBC9; Fri, 10 Mar 2023 06:47:37 -0800 (PST) Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-176261d7f45so6035211fac.11; Fri, 10 Mar 2023 06:47:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678459656; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sFM9cFx4I6hD+gj1NVqX4d9hN+nz0rkv2y+gyZLkCvI=; b=2Q/ndR0GQm840Esuesq/tw09WxIgoIwO0lzAqRFTZI22Yh8+EFJ1DxOAz6T96wvdbP yw7g6Q1WprdBWEAMXQ8d/uEtgEcmHkMU/bhs2CPKTK1kng6RDWs1R1BgeurxGoB4mw5r Yzgj6M7qgBRDC7mJozUfTOHB+I5tZ4Zgk8hWia3qYFIs1hFvGUoWVbCfutCtNWkjb24f kTKigS4cx+hX4N9bph2Pu0w7vEtE5e93F80fcWpYKoPbnkkeQSuHyD4p0MAKQchlX/Du 9OuICpMIqyGgqmRH7xC6e0mG2WwB8o8m9q+wceAXNBbpFf1qcAVXKqMEGTcdg0UrxU78 JBqg== X-Gm-Message-State: AO0yUKXhHq3QgDz1W0Nx6GZsMkYNTXGIijtOmfWIFeZWJXChYJH5NYmx TUDNDeoP2vSffGq7/RfqJrN10iLUwg== X-Received: by 2002:a05:6870:c0d5:b0:172:8999:27fb with SMTP id e21-20020a056870c0d500b00172899927fbmr5812691oad.10.1678459656528; Fri, 10 Mar 2023 06:47:36 -0800 (PST) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id t33-20020a4a96e4000000b00525ccc4caadsm11366ooi.4.2023.03.10.06.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:47:35 -0800 (PST) Received: (nullmailer pid 1543182 invoked by uid 1000); Fri, 10 Mar 2023 14:47:10 -0000 From: Rob Herring <robh@kernel.org> To: Jassi Brar <jassisinghbrar@gmail.com> Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mailbox: Use of_property_read_bool() for boolean properties Date: Fri, 10 Mar 2023 08:47:10 -0600 Message-Id: <20230310144710.1543139-1-robh@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759997017749758229?= X-GMAIL-MSGID: =?utf-8?q?1759997017749758229?= |
Series |
mailbox: Use of_property_read_bool() for boolean properties
|
|
Commit Message
Rob Herring
March 10, 2023, 2:47 p.m. UTC
It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties.
Convert reading boolean properties to to of_property_read_bool().
Signed-off-by: Rob Herring <robh@kernel.org>
---
drivers/mailbox/hi6220-mailbox.c | 5 +----
drivers/mailbox/omap-mailbox.c | 3 +--
2 files changed, 2 insertions(+), 6 deletions(-)
Comments
On Fri, Mar 10, 2023 at 08:47:10AM -0600, Rob Herring wrote: > It is preferred to use typed property access functions (i.e. > of_property_read_<type> functions) rather than low-level > of_get_property/of_find_property functions for reading properties. > Convert reading boolean properties to to of_property_read_bool(). > > Signed-off-by: Rob Herring <robh@kernel.org> > --- > drivers/mailbox/hi6220-mailbox.c | 5 +---- > drivers/mailbox/omap-mailbox.c | 3 +-- > 2 files changed, 2 insertions(+), 6 deletions(-) Ping! > > diff --git a/drivers/mailbox/hi6220-mailbox.c b/drivers/mailbox/hi6220-mailbox.c > index fca61f5312d9..1c73c63598f5 100644 > --- a/drivers/mailbox/hi6220-mailbox.c > +++ b/drivers/mailbox/hi6220-mailbox.c > @@ -325,10 +325,7 @@ static int hi6220_mbox_probe(struct platform_device *pdev) > writel(~0x0, ACK_INT_CLR_REG(mbox->ipc)); > > /* use interrupt for tx's ack */ > - if (of_find_property(node, "hi6220,mbox-tx-noirq", NULL)) > - mbox->tx_irq_mode = false; > - else > - mbox->tx_irq_mode = true; > + mbox->tx_irq_mode = !of_property_read_bool(node, "hi6220,mbox-tx-noirq"); > > if (mbox->tx_irq_mode) > mbox->controller.txdone_irq = true; > diff --git a/drivers/mailbox/omap-mailbox.c b/drivers/mailbox/omap-mailbox.c > index 098c82d87137..fd28ac2120df 100644 > --- a/drivers/mailbox/omap-mailbox.c > +++ b/drivers/mailbox/omap-mailbox.c > @@ -763,8 +763,7 @@ static int omap_mbox_probe(struct platform_device *pdev) > > finfo->name = child->name; > > - if (of_find_property(child, "ti,mbox-send-noirq", NULL)) > - finfo->send_no_irq = true; > + finfo->send_no_irq = of_property_read_bool(child, "ti,mbox-send-noirq"); > > if (finfo->tx_id >= num_fifos || finfo->rx_id >= num_fifos || > finfo->tx_usr >= num_users || finfo->rx_usr >= num_users) > -- > 2.39.2 >
On Tue, Apr 18, 2023 at 11:25 AM Rob Herring <robh@kernel.org> wrote: > > On Fri, Mar 10, 2023 at 08:47:10AM -0600, Rob Herring wrote: > > It is preferred to use typed property access functions (i.e. > > of_property_read_<type> functions) rather than low-level > > of_get_property/of_find_property functions for reading properties. > > Convert reading boolean properties to to of_property_read_bool(). > > > > Signed-off-by: Rob Herring <robh@kernel.org> > > --- > > drivers/mailbox/hi6220-mailbox.c | 5 +---- > > drivers/mailbox/omap-mailbox.c | 3 +-- > > 2 files changed, 2 insertions(+), 6 deletions(-) > > Ping! > Pong :) I don't usually reply back that it looks good and will pick for the merge window. I just do that. So yes, it is not overlooked. cheers
On Tue, Apr 18, 2023 at 11:36 AM Jassi Brar <jassisinghbrar@gmail.com> wrote: > > On Tue, Apr 18, 2023 at 11:25 AM Rob Herring <robh@kernel.org> wrote: > > > > On Fri, Mar 10, 2023 at 08:47:10AM -0600, Rob Herring wrote: > > > It is preferred to use typed property access functions (i.e. > > > of_property_read_<type> functions) rather than low-level > > > of_get_property/of_find_property functions for reading properties. > > > Convert reading boolean properties to to of_property_read_bool(). > > > > > > Signed-off-by: Rob Herring <robh@kernel.org> > > > --- > > > drivers/mailbox/hi6220-mailbox.c | 5 +---- > > > drivers/mailbox/omap-mailbox.c | 3 +-- > > > 2 files changed, 2 insertions(+), 6 deletions(-) > > > > Ping! > > > Pong :) > > I don't usually reply back that it looks good and will pick for the > merge window. I just do that. So yes, it is not overlooked. Okay. No reply nor applying it in over a month is not a great experience for submitters. Rob
On Tue, Apr 18, 2023 at 2:06 PM Rob Herring <robh@kernel.org> wrote: > > On Tue, Apr 18, 2023 at 11:36 AM Jassi Brar <jassisinghbrar@gmail.com> wrote: > > > > On Tue, Apr 18, 2023 at 11:25 AM Rob Herring <robh@kernel.org> wrote: > > > > > > On Fri, Mar 10, 2023 at 08:47:10AM -0600, Rob Herring wrote: > > > > It is preferred to use typed property access functions (i.e. > > > > of_property_read_<type> functions) rather than low-level > > > > of_get_property/of_find_property functions for reading properties. > > > > Convert reading boolean properties to to of_property_read_bool(). > > > > > > > > Signed-off-by: Rob Herring <robh@kernel.org> > > > > --- > > > > drivers/mailbox/hi6220-mailbox.c | 5 +---- > > > > drivers/mailbox/omap-mailbox.c | 3 +-- > > > > 2 files changed, 2 insertions(+), 6 deletions(-) > > > > > > Ping! > > > > > Pong :) > > > > I don't usually reply back that it looks good and will pick for the > > merge window. I just do that. So yes, it is not overlooked. > > Okay. No reply nor applying it in over a month is not a great > experience for submitters. > I sense that. I may be wrong, but I feel any form of ack from a maintainer demotivates others from looking critically at the submission. I have seen revisions asked after many weeks of submission. So my idea is to let a patch roast in public glare. Maybe I should reply after 2-3weeks. -j
diff --git a/drivers/mailbox/hi6220-mailbox.c b/drivers/mailbox/hi6220-mailbox.c index fca61f5312d9..1c73c63598f5 100644 --- a/drivers/mailbox/hi6220-mailbox.c +++ b/drivers/mailbox/hi6220-mailbox.c @@ -325,10 +325,7 @@ static int hi6220_mbox_probe(struct platform_device *pdev) writel(~0x0, ACK_INT_CLR_REG(mbox->ipc)); /* use interrupt for tx's ack */ - if (of_find_property(node, "hi6220,mbox-tx-noirq", NULL)) - mbox->tx_irq_mode = false; - else - mbox->tx_irq_mode = true; + mbox->tx_irq_mode = !of_property_read_bool(node, "hi6220,mbox-tx-noirq"); if (mbox->tx_irq_mode) mbox->controller.txdone_irq = true; diff --git a/drivers/mailbox/omap-mailbox.c b/drivers/mailbox/omap-mailbox.c index 098c82d87137..fd28ac2120df 100644 --- a/drivers/mailbox/omap-mailbox.c +++ b/drivers/mailbox/omap-mailbox.c @@ -763,8 +763,7 @@ static int omap_mbox_probe(struct platform_device *pdev) finfo->name = child->name; - if (of_find_property(child, "ti,mbox-send-noirq", NULL)) - finfo->send_no_irq = true; + finfo->send_no_irq = of_property_read_bool(child, "ti,mbox-send-noirq"); if (finfo->tx_id >= num_fifos || finfo->rx_id >= num_fifos || finfo->tx_usr >= num_users || finfo->rx_usr >= num_users)