From patchwork Fri Mar 10 14:47:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 13169650 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 11468C6FA99 for ; Fri, 10 Mar 2023 16:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=431l7gg4tn0UPiFkHMHUvnG6XCctJp3bbDjC0W/crEs=; b=P4fN5WFiYPywqf ZhlIqUSwpzeSVF0O+UnwJMO6qsYLMOpbX8MZ7dMiTh5HJDpUI8I2UeZllDlKKlXbh7EWRoPnzaC8p PV0z7voDZBl9npE4OX+yNMVE6mXLyajVJCrdHy+bt0sy0RhzH1DuCALxlA86BwUlx54obuLkcHzZr s6QCbWKGqgtv3pZv2qnQ0cE/38Vk2Nz7Dkh/2MkPjtArxcs6DhOe0Kt1moPXn0gI/H6KXLQ9hsHZG 6fp9abtIp/nfhyL78bQV4i/LCq5hkxGHAQ+kZUtPIiKjHIVOyJ6ihxQc3BXYtZFiumEsqa3cYju05 bWBsbuGvXCEMpWsk8j2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pafu7-00FMvP-Fo; Fri, 10 Mar 2023 16:47:39 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pafsR-00FLzC-Vq for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Mar 2023 16:45:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=Ps/svGZ6xWHVJQ0dMU8++7OD08k18rg46UI9xmEWbIc=; b=bmvbTvN68qOx/IungMJq8HiaL/ Y9mfn5BDGVa2VZwPDZ/o2cYwUoQq9O/6TcIoFbPAgkM2ZsfvsQ1XIrj6xorsju+BO4pslBZH+jIpz 9aBhIhXoBBA6MCcATIK7y7LsWhtRWyvX797CeowNLxnnJanid5cU2EBS2mr8WuqEbr22I97yNpHPk qgtBV01uIpvNCtnS03aYPy7QtLzMNgFB+ogk8aLx4/uJV5igj1xYTlFWq+IUjpPB1PqiK3F/IDjJS /W3jEwqDh1tqGcO0NdPKi8eOuG/ArMbjaCfqTSkHrj862OgfvrrljqJOAl6Vk1C74SYSW9pGjL7jc LfxIufLA==; Received: from mail-ot1-f54.google.com ([209.85.210.54]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pae2w-000USy-0L for linux-arm-kernel@lists.infradead.org; Fri, 10 Mar 2023 14:48:40 +0000 Received: by mail-ot1-f54.google.com with SMTP id o4-20020a9d6d04000000b00694127788f4so3038466otp.6 for ; Fri, 10 Mar 2023 06:48:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678459717; 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=Ps/svGZ6xWHVJQ0dMU8++7OD08k18rg46UI9xmEWbIc=; b=B8QPdCEsNCo9N+Z9yNNvG8aC4oMOpdeVOKRlfMxe5D51qx1Wt4i9yaoB525zJHeJUR fvBof0HnGhSqsMhoPIpHMeWElsZt2pOwcJURiq6+Bi0oQRsNStq3HmUVd6RowY4+7CVU g9GRiXC3AcntRTWeJKnsNFbgYDMavb6o4ngbWNdczLzKWzKTPSBoOWwNEorVfH1tWJz5 rLnDMAKo3/wTdqZjfRIL//nkf6L3+3no0Q5/06aHTIffrJfWtHry3ltqy1vkR7eBbBwf 54IKQFCqtgSdB8PK7Jthvx6VWHyq5iMiNOda7L4zbE/wJB4aVJJU0eQO2rdrDn0cuEy6 5XBw== X-Gm-Message-State: AO0yUKWOGV561ceYHjZV8OxyWbA0SlSMdu3XN2bY/UC98BuwjxSE+bEf 7f0Qz8rKEQNOwQcAjeDBOQ== X-Google-Smtp-Source: AK7set9IVJnTY/EvHnm9u8/rDXJ25KPAa+oF7Itt6s3eH5A96+jOhMraQGJ1753yivMUYDLltPrUBA== X-Received: by 2002:a05:6830:3687:b0:693:d927:645e with SMTP id bk7-20020a056830368700b00693d927645emr13293296otb.6.1678459717375; Fri, 10 Mar 2023 06:48:37 -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 63-20020a9d0845000000b00690f6d9a737sm135685oty.8.2023.03.10.06.48.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:48:36 -0800 (PST) Received: (nullmailer pid 1546057 invoked by uid 1000); Fri, 10 Mar 2023 14:47:30 -0000 From: Rob Herring To: Helge Deller , Michal Simek Cc: devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] fbdev: Use of_property_read_bool() for boolean properties Date: Fri, 10 Mar 2023 08:47:30 -0600 Message-Id: <20230310144730.1546031-1-robh@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230310_144838_900690_15BF1F4A X-CRM114-Status: GOOD ( 13.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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/video/fbdev/offb.c | 4 ++-- drivers/video/fbdev/sm501fb.c | 4 ++-- drivers/video/fbdev/tcx.c | 3 +-- drivers/video/fbdev/xilinxfb.c | 3 +-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c index f7ad6bc9d02d..b97d251d894b 100644 --- a/drivers/video/fbdev/offb.c +++ b/drivers/video/fbdev/offb.c @@ -549,10 +549,10 @@ static void offb_init_nodriver(struct platform_device *parent, struct device_nod int foreign_endian = 0; #ifdef __BIG_ENDIAN - if (of_get_property(dp, "little-endian", NULL)) + if (of_property_read_bool(dp, "little-endian")) foreign_endian = FBINFO_FOREIGN_ENDIAN; #else - if (of_get_property(dp, "big-endian", NULL)) + if (of_property_read_bool(dp, "big-endian")) foreign_endian = FBINFO_FOREIGN_ENDIAN; #endif diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index f743bfbde2a6..1f3cbe723def 100644 --- a/drivers/video/fbdev/sm501fb.c +++ b/drivers/video/fbdev/sm501fb.c @@ -1737,10 +1737,10 @@ static int sm501fb_init_fb(struct fb_info *fb, enum sm501_controller head, #if defined(CONFIG_OF) #ifdef __BIG_ENDIAN - if (of_get_property(info->dev->parent->of_node, "little-endian", NULL)) + if (of_property_read_bool(info->dev->parent->of_node, "little-endian")) fb->flags |= FBINFO_FOREIGN_ENDIAN; #else - if (of_get_property(info->dev->parent->of_node, "big-endian", NULL)) + if (of_property_read_bool(info->dev->parent->of_node, "big-endian")) fb->flags |= FBINFO_FOREIGN_ENDIAN; #endif #endif diff --git a/drivers/video/fbdev/tcx.c b/drivers/video/fbdev/tcx.c index 01d87f53324d..f2eaf6e7fff6 100644 --- a/drivers/video/fbdev/tcx.c +++ b/drivers/video/fbdev/tcx.c @@ -379,8 +379,7 @@ static int tcx_probe(struct platform_device *op) spin_lock_init(&par->lock); - par->lowdepth = - (of_find_property(dp, "tcx-8-bit", NULL) != NULL); + par->lowdepth = of_property_read_bool(dp, "tcx-8-bit"); sbusfb_fill_var(&info->var, dp, 8); info->var.red.length = 8; diff --git a/drivers/video/fbdev/xilinxfb.c b/drivers/video/fbdev/xilinxfb.c index 1ac83900a21c..c17cfffd9a84 100644 --- a/drivers/video/fbdev/xilinxfb.c +++ b/drivers/video/fbdev/xilinxfb.c @@ -469,8 +469,7 @@ static int xilinxfb_of_probe(struct platform_device *pdev) pdata.yvirt = prop[1]; } - if (of_find_property(pdev->dev.of_node, "rotate-display", NULL)) - pdata.rotate_screen = 1; + pdata.rotate_screen = of_property_read_bool(pdev->dev.of_node, "rotate-display"); platform_set_drvdata(pdev, drvdata); return xilinxfb_assign(pdev, drvdata, &pdata);