From patchwork Wed May 13 18:56:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 212040 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=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY, URIBL_BLOCKED, USER_AGENT_GIT 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 04DA2C433E1 for ; Wed, 13 May 2020 18:56:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA2CA2065C for ; Wed, 13 May 2020 18:56:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390423AbgEMS4j (ORCPT ); Wed, 13 May 2020 14:56:39 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:51900 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390405AbgEMS4i (ORCPT ); Wed, 13 May 2020 14:56:38 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id A0F5C2A2A5C Received: by jupiter.universe (Postfix, from userid 1000) id 9319A480128; Wed, 13 May 2020 20:56:29 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel , Rob Herring , Greg Kroah-Hartman , "Rafael J . Wysocki" Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Sebastian Reichel Subject: [PATCHv1 16/19] power: supply: sbs-battery: switch from of_property_* to device_property_* Date: Wed, 13 May 2020 20:56:12 +0200 Message-Id: <20200513185615.508236-17-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200513185615.508236-1-sebastian.reichel@collabora.com> References: <20200513185615.508236-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Switch from DT specific of_property_* API to generic and more modern device_property_* API. Signed-off-by: Sebastian Reichel --- drivers/power/supply/sbs-battery.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c index 7c6905a486da..73dfe526c867 100644 --- a/drivers/power/supply/sbs-battery.c +++ b/drivers/power/supply/sbs-battery.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include @@ -1016,7 +1016,7 @@ static int sbs_probe(struct i2c_client *client, if (!chip) return -ENOMEM; - chip->flags = (u32)(uintptr_t)of_device_get_match_data(&client->dev); + chip->flags = (u32)(uintptr_t)device_get_match_data(&client->dev); chip->client = client; chip->enable_detection = false; psy_cfg.of_node = client->dev.of_node; @@ -1027,13 +1027,13 @@ static int sbs_probe(struct i2c_client *client, /* use pdata if available, fall back to DT properties, * or hardcoded defaults if not */ - rc = of_property_read_u32(client->dev.of_node, "sbs,i2c-retry-count", - &chip->i2c_retry_count); + rc = device_property_read_u32(&client->dev, "sbs,i2c-retry-count", + &chip->i2c_retry_count); if (rc) chip->i2c_retry_count = 0; - rc = of_property_read_u32(client->dev.of_node, "sbs,poll-retry-count", - &chip->poll_retry_count); + rc = device_property_read_u32(&client->dev, "sbs,poll-retry-count", + &chip->poll_retry_count); if (rc) chip->poll_retry_count = 0; @@ -1043,7 +1043,7 @@ static int sbs_probe(struct i2c_client *client, } chip->i2c_retry_count = chip->i2c_retry_count + 1; - chip->charger_broadcasts = !of_property_read_bool(client->dev.of_node, + chip->charger_broadcasts = !device_property_read_bool(&client->dev, "sbs,disable-charger-broadcasts"); chip->gpio_detect = devm_gpiod_get_optional(&client->dev,