From patchwork Fri Mar 10 14:47:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 67494 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp951665wrd; Fri, 10 Mar 2023 08:00:54 -0800 (PST) X-Google-Smtp-Source: AK7set+R1wnXbDekdYH+96WxOOl1cXv/LYWNazuC4lOUjNtdqqWZKj+cVyVdpCcrqYzFn3rORJnU X-Received: by 2002:aa7:956b:0:b0:619:d5c2:e97 with SMTP id x11-20020aa7956b000000b00619d5c20e97mr19081527pfq.2.1678464054181; Fri, 10 Mar 2023 08:00:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678464054; cv=none; d=google.com; s=arc-20160816; b=PN2lf51xIKi7WasUnjH/ExUBXWgEhHcIbE5AaLCH4u3UGof5/Y45libSBiZvnZd8Yn n8+Tjvi7sKMu/xEtkk93DWhhAkLfnawEIXnIyT0kbL+YEO4/q/fJHpQp0P/A+UKMyMqT r1EQRF5nkqTWPQYPWdS5SRt1D5LgGvpcLHyIJLAeu4kW0ltSbN7D9L+cWU4MPw06mzXw 3zUE3uUHtv+kQrNZsnmjD2qWLyz181yLqL631nR0KLF3zjPLEIDL5xIurxvIrdR+5jOP tjT5cx7qpqsrz4Yo9kbO5qfrf1EBqtENscyrM9vjKJl4C07/YhVM1f4YNF6silHoVJB7 oCpQ== 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=2hDeOhL3khuyGbkCHxGQebu7qrt5FEKqtJ9+s/BvlnU=; b=j2HFD/0WE0+1Nr0gxiPZqP8MZMgMDRwKBm8e7++DOSeCDgCsaCO2G/3doGjc4tBqQ6 ePNMpxnkOlm1uObWghMlcNLOVpua9BbLNRAcexUJ4oYoMXh4MENqLYANZTmCGntioVUf Z4wHJO2fMmcuwpd34+wmYTEZZqPtoOz1y6lJTp03zenX/B6/BZjzlUqUZu6MrpNeOtp6 lkkURAr9/XukdV+qJbQlik9ymF94LZH6vEGmpPpIzNnljOYII1h4nFQbVU2/UKUc+p3Z J1yF9CRqy+Cat1fEpxTrWBAycWhPMN6bHu+/5pYS9+YUsD+CRIa2betlXUO/6AnWMCNy zfgQ== 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 r3-20020a635d03000000b004a4eae7c943si104117pgb.535.2023.03.10.08.00.37; Fri, 10 Mar 2023 08:00:54 -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 S233742AbjCJPBP (ORCPT + 99 others); Fri, 10 Mar 2023 10:01:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233626AbjCJPAu (ORCPT ); Fri, 10 Mar 2023 10:00:50 -0500 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C44613595D; Fri, 10 Mar 2023 06:54:37 -0800 (PST) Received: by mail-ot1-x330.google.com with SMTP id e9-20020a056830200900b00694651d19f6so3019519otp.12; Fri, 10 Mar 2023 06:54:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678459703; 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=2hDeOhL3khuyGbkCHxGQebu7qrt5FEKqtJ9+s/BvlnU=; b=qDwi97pYbhCD1YPf3kNBg8tt77Uec/aP99EaGlQ3Rh5S31gM/31lOiyC8jKRo6E5Bi Yqzbppm8uyV0CAOXisfOjj4b4Gnv2pOG79XUZsCUPPxSlupMG1Vl2LdPasRXANiyZBTw F4NHxV0Yle/aCWI/+vOgUB264XTT2OdD7+D9CFrlrmr+UG3WTRmbf5Vx1ILvcDa3LK3m 2uKdo92JN2XwQMuUzsI0KMwE716GcmJm/zGWMvQXu9T+RSoiiBkh0f3aBIVfYyryH77D yUukTtH5JpZx9xiiYd5/enN0erYHd1P3r5VUV+yTWH6D2PwO05JxnIn3TOtCCcJML5Bz xtDA== X-Gm-Message-State: AO0yUKUlZk7aeGTp4Me7ebegfZ7ugbrgnq3VFctONyvDADKId8+IEU4a YHWJjc7qAg+N+nb4Mxlwft6Vh0YRaQ== X-Received: by 2002:a9d:6118:0:b0:694:3972:dba8 with SMTP id i24-20020a9d6118000000b006943972dba8mr10239231otj.6.1678459702760; Fri, 10 Mar 2023 06:48:22 -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 m30-20020a05683026de00b00690eeb8b436sm101859otu.65.2023.03.10.06.48.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:48:22 -0800 (PST) Received: (nullmailer pid 1544956 invoked by uid 1000); Fri, 10 Mar 2023 14:47:23 -0000 From: Rob Herring To: "David S. Miller" Cc: devicetree@vger.kernel.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] sbus: display7seg: Use of_property_read_bool() for boolean properties Date: Fri, 10 Mar 2023 08:47:22 -0600 Message-Id: <20230310144723.1544930-1-robh@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759997123879805326?= X-GMAIL-MSGID: =?utf-8?q?1759997123879805326?= It is preferred to use typed property access functions (i.e. of_property_read_ 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 --- drivers/sbus/char/display7seg.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c index d93595b39afa..8bee31f03126 100644 --- a/drivers/sbus/char/display7seg.c +++ b/drivers/sbus/char/display7seg.c @@ -31,8 +31,8 @@ static int sol_compat = 0; /* Solaris compatibility mode */ /* Solaris compatibility flag - * The Solaris implementation omits support for several - * documented driver features (ref Sun doc 806-0180-03). - * By default, this module supports the documented driver + * documented driver features (ref Sun doc 806-0180-03). + * By default, this module supports the documented driver * abilities, rather than the Solaris implementation: * * 1) Device ALWAYS reverts to OBP-specified FLIPPED mode @@ -44,7 +44,7 @@ static int sol_compat = 0; /* Solaris compatibility mode */ * omitting above features, set this parameter to non-zero. */ module_param(sol_compat, int, 0); -MODULE_PARM_DESC(sol_compat, +MODULE_PARM_DESC(sol_compat, "Disables documented functionality omitted from Solaris driver"); MODULE_AUTHOR("Eric Brower "); @@ -63,7 +63,7 @@ struct d7s *d7s_device; * | DP | ALARM | FLIP | 4 | 3 | 2 | 1 | 0 | * ----------------------------------------- * - * DP - Toggles decimal point on/off + * DP - Toggles decimal point on/off * ALARM - Toggles "Alarm" LED green/red * FLIP - Inverts display for upside-down mounted board * bits 0-4 - 7-segment display contents @@ -200,9 +200,8 @@ static int d7s_probe(struct platform_device *op) */ regs = readb(p->regs); opts = of_find_node_by_path("/options"); - if (opts && - of_get_property(opts, "d7s-flipped?", NULL)) - p->flipped = true; + if (opts) + p->flipped = of_property_read_bool(opts, "d7s-flipped?"); if (p->flipped) regs |= D7S_FLIP;