Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2988934rwb; Mon, 5 Sep 2022 04:58:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR7DnopFnqFIkqXS/ogAajQpx+ifWw+5mGva8NUuT4oBKBl1HF37vbn3E3Ulr08YMB5yfBYn X-Received: by 2002:a63:fa17:0:b0:430:9ec5:b62d with SMTP id y23-20020a63fa17000000b004309ec5b62dmr16036016pgh.575.1662379130727; Mon, 05 Sep 2022 04:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662379130; cv=none; d=google.com; s=arc-20160816; b=o/8XMtUFw32T8amTWXCQwEuzsxcQfBvrFm0KSSIbMXVvbN1XskbBelDrxn18Liqvjj y5lF+oNTvuI5Utamhut5gU612oghOAfhoOt42Db5cQoH8EJ7C5wpBDOrzSAU8HZeGuUb BdNeE4L3CqSEk+WJ9aO8RDDmSw3a1n5C04y6hrjcr5kpT0yu+9Lp7L82VPbVCNQtvbSf XxeYd4kCHXZ2+SYgLT1tBpuyLIHatT7LfpF/Z382gFSuEEaMlwViW5fe/Vng295KyhnN cZDsQBPYXVHg3c2fzsZzFu/BreCGuAwRckwKW80pHzLt1ymoNA1/fvJtcn/Ik/MPtvL+ pfrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kd7g7axcQ4As/Ok0I5izIzwGPbtYaPyDkbWIGk2kRMc=; b=K/3xZ4iSgn2i1jT3ffLcKLq25YzHN+1EMyn6Dv3IUpQk22r91wkngQlLjJFWLln+2W TYXuhpUb+sOWoRHwnr+1gbJ9C4xiUw0ZStn/X9XzHAb679K2JOlu6CoY7+FhJrRmZ9kZ 3Y9xeeUndrW95+IKEOdTgbTeSZteCd7rOSyXz5zjWbIeJf6ftav0lWkMUyDWQ1yezqAX D3XIk3N77A5YDrg1adlaXsLw87lRCa7NW0K8uaEFt5aYPLUkOr5EUWzMsIIRea6wBoHW yTDeX1K4CU1qdpmY2xqs9cL/yuBGFtehRErC7uMvjDKW/HEzVnSY1xr5AbNkzSwNRbH6 ujZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=a4V6ibAx; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g185-20020a636bc2000000b004305794e120si6917506pgc.570.2022.09.05.04.58.37; Mon, 05 Sep 2022 04:58:50 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=a4V6ibAx; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237410AbiIEKlX (ORCPT + 99 others); Mon, 5 Sep 2022 06:41:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236511AbiIEKlT (ORCPT ); Mon, 5 Sep 2022 06:41:19 -0400 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2927F4C624; Mon, 5 Sep 2022 03:41:19 -0700 (PDT) Received: by mail-qt1-x82b.google.com with SMTP id g14so5837143qto.11; Mon, 05 Sep 2022 03:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=kd7g7axcQ4As/Ok0I5izIzwGPbtYaPyDkbWIGk2kRMc=; b=a4V6ibAx1P4YjsDZwhtMLMuWUwWCK3+Yn9JF3VwjA4fF5N0JKuAGKvW0x7Oeq36vRu ZD2NpBYMNC8pDvV3B9bTynqivMhFDkGOtzwr7JY7i6mY6fQ9mOwr7PCsrNfMvKVlTB6m AQwPmzkKfJqq/qd3lYrZAvkeG/klQ18FzMuuftSPGpjscQilPNTppd9oLyhCECyBTnmS uo+4FUsm1gWsG4XuM9BafRncQA8YVM65g/X3SPg8260dxRuAheVR5JT3lXCfMda99osm 3ghxFB0uVJftBWwHDXIPOXJK9RgFq/ZehUGlD71aQbbwaHNfsi/Wi+FWVWYy7rB5ueEz 4ZYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=kd7g7axcQ4As/Ok0I5izIzwGPbtYaPyDkbWIGk2kRMc=; b=fS38WuL+y89CFcR4bObI+GY0Jt70yC4nxDJvdd+qk11KLxRHNaV0zKSRBZcJNleBGX CkriUpWIID6NE6uRoc6tq7qKOJichj79PcUGs6nL6yM+ISSYeLZnUuOAvrsrLj4nfXYB XSqs/koI41Rgj/Zznv+A+FfLktK/lsx5o6Hdl6AC7AWY/RrWBibSglHr1WKFz7oU+ruB mGe11AbjQaDuydcgcUcsV2aLlVpd75wJ2yzx73GaGPAKy8BGi8Po0t9kFBB0odiAnLMO 0oq6iCGI24zSt5TDPuPHlT14w/e3zWUUhS1jevfDVip3ZyuP8D2mjZNx7UJrqPM85wSV /kVg== X-Gm-Message-State: ACgBeo3wLJBBYCGCx0ilDr3W3hnKIF9+sMSnU3a2PCmnOA45cVmhXF03 JmpoJP0D2vWhNH5xfzYiVTE+2IhpoBk61Lg2ffQ= X-Received: by 2002:ac8:7dd0:0:b0:344:afc1:b11d with SMTP id c16-20020ac87dd0000000b00344afc1b11dmr37941390qte.195.1662374478234; Mon, 05 Sep 2022 03:41:18 -0700 (PDT) MIME-Version: 1.0 References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> <20220903-gpiod_get_from_of_node-remove-v1-9-b29adfb27a6c@gmail.com> In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-9-b29adfb27a6c@gmail.com> From: Andy Shevchenko Date: Mon, 5 Sep 2022 13:40:42 +0300 Message-ID: Subject: Re: [PATCH v1 09/11] regulator: bd9576: switch to using devm_fwnode_gpiod_get() To: Dmitry Torokhov Cc: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , =?UTF-8?Q?Pali_Roh=C3=A1r?= , LINUXWATCHDOG , USB , "open list:GPIO SUBSYSTEM" , linux-pci , linux-tegra , "open list:MEMORY TECHNOLOGY..." , Linux Kernel Mailing List , dri-devel , linux-stm32@st-md-mailman.stormreply.com, linux-arm Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Mon, Sep 5, 2022 at 9:33 AM Dmitry Torokhov wrote: > > I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() > so that gpiolib can be cleaned a bit, so let's switch to the generic > fwnode property API. > > While at it switch the rest of the calls to read properties in > bd957x_probe() to the generic device property API as well. With or without below addressed, Reviewed-by: Andy Shevchenko > Signed-off-by: Dmitry Torokhov > > diff --git a/drivers/regulator/bd9576-regulator.c b/drivers/regulator/bd9576-regulator.c > index aa42da4d141e..393c8693b327 100644 > --- a/drivers/regulator/bd9576-regulator.c > +++ b/drivers/regulator/bd9576-regulator.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -939,8 +940,8 @@ static int bd957x_probe(struct platform_device *pdev) > } > > ic_data->regmap = regmap; > - vout_mode = of_property_read_bool(pdev->dev.parent->of_node, > - "rohm,vout1-en-low"); > + vout_mode = device_property_read_bool(pdev->dev.parent, > + "rohm,vout1-en-low"); They all using parent device and you may make code neater by adding struct device *parent = pdev->dev.parent; at the definition block of the probe function. > if (vout_mode) { > struct gpio_desc *en; > > @@ -948,10 +949,10 @@ static int bd957x_probe(struct platform_device *pdev) > > /* VOUT1 enable state judged by VOUT1_EN pin */ > /* See if we have GPIO defined */ > - en = devm_gpiod_get_from_of_node(&pdev->dev, > - pdev->dev.parent->of_node, > - "rohm,vout1-en-gpios", 0, > - GPIOD_OUT_LOW, "vout1-en"); > + en = devm_fwnode_gpiod_get(&pdev->dev, > + dev_fwnode(pdev->dev.parent), > + "rohm,vout1-en", GPIOD_OUT_LOW, > + "vout1-en"); > if (!IS_ERR(en)) { > /* VOUT1_OPS gpio ctrl */ > /* > @@ -986,8 +987,8 @@ static int bd957x_probe(struct platform_device *pdev) > * like DDR voltage selection. > */ > platform_set_drvdata(pdev, ic_data); > - ddr_sel = of_property_read_bool(pdev->dev.parent->of_node, > - "rohm,ddr-sel-low"); > + ddr_sel = device_property_read_bool(pdev->dev.parent, > + "rohm,ddr-sel-low"); > if (ddr_sel) > ic_data->regulator_data[2].desc.fixed_uV = 1350000; > else > > -- > b4 0.10.0-dev-fc921 -- With Best Regards, Andy Shevchenko