From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760976AbcINHou (ORCPT ); Wed, 14 Sep 2016 03:44:50 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:36619 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760431AbcINHoo (ORCPT ); Wed, 14 Sep 2016 03:44:44 -0400 From: Kishon Vijay Abraham I To: CC: , Subject: [PATCH 05/51] phy: qcom-ufs: use of_property_read_bool Date: Wed, 14 Sep 2016 13:13:46 +0530 Message-ID: <1473839072-5673-6-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1473839072-5673-1-git-send-email-kishon@ti.com> References: <1473839072-5673-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Julia Lawall Use of_property_read_bool to check for the existence of a property. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression e1,e2,x; @@ - if (of_get_property(e1,e2,NULL)) - x = true; - else - x = false; + x = of_property_read_bool(e1,e2); // Signed-off-by: Julia Lawall Signed-off-by: Kishon Vijay Abraham I --- drivers/phy/phy-qcom-ufs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/phy/phy-qcom-ufs.c b/drivers/phy/phy-qcom-ufs.c index 107cb57..18a5b49 100644 --- a/drivers/phy/phy-qcom-ufs.c +++ b/drivers/phy/phy-qcom-ufs.c @@ -283,10 +283,8 @@ static int __ufs_qcom_phy_init_vreg(struct phy *phy, err = 0; } snprintf(prop_name, MAX_PROP_NAME, "%s-always-on", name); - if (of_get_property(dev->of_node, prop_name, NULL)) - vreg->is_always_on = true; - else - vreg->is_always_on = false; + vreg->is_always_on = of_property_read_bool(dev->of_node, + prop_name); } if (!strcmp(name, "vdda-pll")) { -- 1.7.9.5