From patchwork Sat Sep 3 00:55:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 602687 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4206C6FA86 for ; Sat, 3 Sep 2022 00:56:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230500AbiICA4L (ORCPT ); Fri, 2 Sep 2022 20:56:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230117AbiICA4K (ORCPT ); Fri, 2 Sep 2022 20:56:10 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5484E9A99F; Fri, 2 Sep 2022 17:56:08 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id i5-20020a17090a2a0500b001fd8708ffdfso7017312pjd.2; Fri, 02 Sep 2022 17:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=ZNNnL0ArxV3UchUohJJ2ySkOJIf+KXfLKML33D2Bf7k=; b=bVaAaKdZLy10hzqDxhpmfjwyC/kkz6xkRZTUYcLfYcuylJI2fjAm2Q7TgoVU7Olzf3 cXDpIFSPa/qkpvjw4FLzF0hPEY1oQPkQmdGMEt2sTUMsMNV7exxB9L9n9dDSzJguxxfe 0FvKWXJ+5duWII7/fYe9nm4JHJKzin5M65CodOYWzYKYezlkLlIobIujR7gqVH3hIDf/ Zy5KO7QC8ITH+QbagFqp3mtsFfcVHOX2gR2W8FL2y2SnuGTl7BwS6naxR+vviF8lWgDA XLz4d4ul6O4QGYCP2sPtrEqlsP1ub0e+VX6PpY5GPgph99ERtD+JFijsF0aRYwoqUOdb dUnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=ZNNnL0ArxV3UchUohJJ2ySkOJIf+KXfLKML33D2Bf7k=; b=t9xqbdsMYTGnW1WUEHnONQ24RQrSjausg4cAq5wneWh1TH7cYKTbKxtyTn94S2HQ0b /F/12K/FoRovImXltO3anHVVgGFLyLHxd38Stjv8J9qnTOMmYN5/iZcr3Zmo5kSt4fG8 WgHsveIxjzerYtjWM+Fqrg1KEum99J5jB3bjz8sI3c/7Ql40i5E4AdZE2JFj4MdbK2Rk 3rCfZ7DOmEYW25pX+Sg5RsPsOtEEfRpAr3TXjSoX6Ea3MWsEwXTpGkiW14mypQinr17W 9uSQEFhuti1U+CgfLgw9mpQLsB+zUoD5WkLRUTVPv0RTrqbTMX0g8XowVcsPx3yX6pAH EmGQ== X-Gm-Message-State: ACgBeo3WFZ9z8BqoT1fu9pZG0HMsuKBaPDJB70VCssyPQpKYb2Z7ViBv utJBdXIyHHk5ri+Yycr7KMxICqHI2I4= X-Google-Smtp-Source: AA6agR7ENpqU1vibIKXWvd0I//Z20UictvL3atkTGHCZNfEHdCTWz2LWzTss7431Rg49sgEZ7AXtsg== X-Received: by 2002:a17:90b:38c9:b0:1ff:f240:101c with SMTP id nn9-20020a17090b38c900b001fff240101cmr7283042pjb.143.1662166567693; Fri, 02 Sep 2022 17:56:07 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:ea21:afd4:e65e:539c]) by smtp.gmail.com with ESMTPSA id nn5-20020a17090b38c500b001f7a76d6f28sm2152933pjb.18.2022.09.02.17.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 17:56:07 -0700 (PDT) From: Dmitry Torokhov To: Linus Walleij , Pavel Machek , Bartosz Golaszewski Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH v1 1/3] leds: gpio: switch to using devm_fwnode_gpiod_get() Date: Fri, 2 Sep 2022 17:55:25 -0700 Message-Id: <20220902-get_gpiod_from_child-remove-v1-1-1e47125df20f@gmail.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220902-get_gpiod_from_child-remove-v1-0-1e47125df20f@gmail.com> References: <20220902-get_gpiod_from_child-remove-v1-0-1e47125df20f@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-fc921 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org devm_fwnode_get_gpiod_from_child() is going away as the name is too unwieldy, let's switch to using the new devm_fwnode_gpiod_get(). Signed-off-by: Dmitry Torokhov diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index 092eb59a7d32..ce4e79939731 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -151,9 +151,8 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev) * will be updated after LED class device is registered, * Only then the final LED name is known. */ - led.gpiod = devm_fwnode_get_gpiod_from_child(dev, NULL, child, - GPIOD_ASIS, - NULL); + led.gpiod = devm_fwnode_gpiod_get(dev, child, NULL, GPIOD_ASIS, + NULL); if (IS_ERR(led.gpiod)) { fwnode_handle_put(child); return ERR_CAST(led.gpiod); From patchwork Sat Sep 3 00:55:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 602523 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20CA3C54EE9 for ; Sat, 3 Sep 2022 00:56:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231247AbiICA4N (ORCPT ); Fri, 2 Sep 2022 20:56:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231204AbiICA4M (ORCPT ); Fri, 2 Sep 2022 20:56:12 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77CB194EE3; Fri, 2 Sep 2022 17:56:09 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id 76so3450019pfy.3; Fri, 02 Sep 2022 17:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=xyJjUidnudJLgIqG5SiNAwy6tRLfWVHMLupHXGHYM8E=; b=egVUTjzKxCuf59ViPh/9XDNdI7lLI7bph08ZC0TzYNvDbNcoBf66q/IJ9hKpXKugKM HxSI0FpplauIrZt0NgMmz2TLRZv8jHW7aEqZUWmZtsWBMQ1Ct3syt51OAVJ/0A2550Or uES1KCRA//hefGSiryQpiWNeTtmrzb77Yd9BOGj8air3KjWHyOEdLyJAkRazV7zLaDyt pnt51tRALZ4aU2Ygy43PCBpWaq2q1Il/SbYjiX4KuENM04+B7ytKMkyeNITEG67NcXFZ eTdv1NC47PuTIfaSSqtriBakW44a2oEOtcGnmCIOL3WuvmYwP4dipdogg0H+zf8jT7cL 8sZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=xyJjUidnudJLgIqG5SiNAwy6tRLfWVHMLupHXGHYM8E=; b=YrRYv2LjNeKhEDHk5aQaN+G5Dl1Rm0mZiUmwVxRxJGDAmIshqLdhpKl6q7d0IdJCP1 0isp3SzX9GfxkZksq1juOTQo7qyyN9iLkuhE1SbTqJ9rPIg/8daUy0DRyedr/BmeUB1C EhVKOny9XuDVUZnXjDq9uoJbO4wTcQK5wuRiHBKj3dT0SFKSXbV4n0KGvfBv0VhABU/t urPRbY5ZJ1k+gNSvSXiGaRfuKLznMgmtF5827c8xQJ4xeiycEDmA22XhaNber+TsVkid U0UOVDsqe4RLnq79ooefmwgBZdnyThbzliPqraU/vqQVmjierKlc73ZixybKwuG01RVz mK/g== X-Gm-Message-State: ACgBeo3OuRYeolufEdmuN4R0vjk1koAAnZOZyoR9Dmg+wgkxan2aFSsU mhXhfYESaxGSdNx4VGG/9rM= X-Google-Smtp-Source: AA6agR6V0VjewkBJ9cuTuCw6uCDSkgavq8AVtPqNivS+eC50jQb8KKSaRsklwFn6rw1uExwRy1ye8Q== X-Received: by 2002:a65:5b4d:0:b0:42b:31fd:b2c0 with SMTP id y13-20020a655b4d000000b0042b31fdb2c0mr32251039pgr.609.1662166568713; Fri, 02 Sep 2022 17:56:08 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:ea21:afd4:e65e:539c]) by smtp.gmail.com with ESMTPSA id nn5-20020a17090b38c500b001f7a76d6f28sm2152933pjb.18.2022.09.02.17.56.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 17:56:08 -0700 (PDT) From: Dmitry Torokhov To: Linus Walleij , Pavel Machek , Bartosz Golaszewski Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH v1 2/3] leds: lgm-sso: switch to using devm_fwnode_gpiod_get() Date: Fri, 2 Sep 2022 17:55:26 -0700 Message-Id: <20220902-get_gpiod_from_child-remove-v1-2-1e47125df20f@gmail.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220902-get_gpiod_from_child-remove-v1-0-1e47125df20f@gmail.com> References: <20220902-get_gpiod_from_child-remove-v1-0-1e47125df20f@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-fc921 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org devm_fwnode_get_gpiod_from_child() is going away as the name is too unwieldy, let's switch to using the new devm_fwnode_gpiod_get(). Signed-off-by: Dmitry Torokhov diff --git a/drivers/leds/blink/leds-lgm-sso.c b/drivers/leds/blink/leds-lgm-sso.c index 6f270c0272fb..35c61311e7fd 100644 --- a/drivers/leds/blink/leds-lgm-sso.c +++ b/drivers/leds/blink/leds-lgm-sso.c @@ -635,9 +635,8 @@ __sso_led_dt_parse(struct sso_led_priv *priv, struct fwnode_handle *fw_ssoled) led->priv = priv; desc = &led->desc; - led->gpiod = devm_fwnode_get_gpiod_from_child(dev, NULL, - fwnode_child, - GPIOD_ASIS, NULL); + led->gpiod = devm_fwnode_gpiod_get(dev, fwnode_child, NULL, + GPIOD_ASIS, NULL); if (IS_ERR(led->gpiod)) { ret = dev_err_probe(dev, PTR_ERR(led->gpiod), "led: get gpio fail!\n"); goto __dt_err; From patchwork Sat Sep 3 00:55:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 602686 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65D6CECAAA1 for ; Sat, 3 Sep 2022 00:56:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231280AbiICA4O (ORCPT ); Fri, 2 Sep 2022 20:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231203AbiICA4M (ORCPT ); Fri, 2 Sep 2022 20:56:12 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 839069F8D2; Fri, 2 Sep 2022 17:56:10 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id 199so3461218pfz.2; Fri, 02 Sep 2022 17:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=xGmWZlVa2R1S/KqsTQgaTSfS4nP2t0LKMUf6y1XEKCM=; b=cDIIEd7M8nnSQlDC54Z7Yo3UrnqUi4A7TAmBRN9WcheMU+U47MOqWivq6KYl2zhBCK DFo3S9U2VAvyGjHem9H+pvg8GHd3ZsbGtdmWSMC+U7wSoET/gUAAeFlBuOSgJjcUFYj3 hA05nrVI6Lvpnk4G+4Nrc91wwiYZkpkdhjMws/chzHcRyy2RruVPETwXDWz4hsDaTxRW noWsCNqAmZ8kVXflGEuruSpgRVAEaStc4qR/LWT84rl6hV/Qkf8dGdPKWmqeA+GPygM7 It9Z/1faq3SmPTC9iGdpUSn18gU4UdBec5lsYqmmyKDQ5eQU6J4wM4YDO/RwZ9CNWjiG Qugw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=xGmWZlVa2R1S/KqsTQgaTSfS4nP2t0LKMUf6y1XEKCM=; b=XyImFRyWPz8bH1pWt6Ojw1Ih1jmpKrh2tMcPLd4/NngYaAHGXnGafxl4NY30ViAJt0 oiIyQOd03LyMZjt1aVPv9urPBCXIERfjoTTMe9wy17IIgfFLraoiJqMdXK2mQ7RSL4ca BL5uwO3Nxoxq5tNph9h3j9qu1pqENztrb7rZt57aG6TOMIpJ/4bwuAXTlEaSqpOzyaD1 aO5tQDZbRu9cR216HH7HBzidqDpm7+qQ78VlNC8FcdpZ/wTJ9eqPze7dChwt6npd7Db0 8s4oKzXvCnXISLgyS61ZWj8NeNIosqAvSap86mjvULqiKv0TDgh7I2IpuLQBxIuGKS2b FCBA== X-Gm-Message-State: ACgBeo0b41Up9NMVEISGR++KPlgbdlMUYTP1ttEOboptCVFomTiFaGtH gn39Ala19FCajzF+oX6h5zM= X-Google-Smtp-Source: AA6agR5yHlx2bsV0Dsen7pKGH67Qa8RzkllI3HqfK2dkf3NB2D1r2P53kQ2iMCX5kFPtPpEFAwC54A== X-Received: by 2002:a63:6e09:0:b0:430:663:7757 with SMTP id j9-20020a636e09000000b0043006637757mr14626722pgc.340.1662166569922; Fri, 02 Sep 2022 17:56:09 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:ea21:afd4:e65e:539c]) by smtp.gmail.com with ESMTPSA id nn5-20020a17090b38c500b001f7a76d6f28sm2152933pjb.18.2022.09.02.17.56.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 17:56:09 -0700 (PDT) From: Dmitry Torokhov To: Linus Walleij , Pavel Machek , Bartosz Golaszewski Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH v1 3/3] gpiolib: remove devm_fwnode_get_[index_]gpiod_from_child() Date: Fri, 2 Sep 2022 17:55:27 -0700 Message-Id: <20220902-get_gpiod_from_child-remove-v1-3-1e47125df20f@gmail.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220902-get_gpiod_from_child-remove-v1-0-1e47125df20f@gmail.com> References: <20220902-get_gpiod_from_child-remove-v1-0-1e47125df20f@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-fc921 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Now that there are no more users of these APIs in the kernel we can remove them. Signed-off-by: Dmitry Torokhov diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index fe0f460d9a3b..2ccda8567533 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -594,27 +594,6 @@ struct gpio_desc *devm_fwnode_gpiod_get(struct device *dev, flags, label); } -static inline -struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev, - const char *con_id, int index, - struct fwnode_handle *child, - enum gpiod_flags flags, - const char *label) -{ - return devm_fwnode_gpiod_get_index(dev, child, con_id, index, - flags, label); -} - -static inline -struct gpio_desc *devm_fwnode_get_gpiod_from_child(struct device *dev, - const char *con_id, - struct fwnode_handle *child, - enum gpiod_flags flags, - const char *label) -{ - return devm_fwnode_gpiod_get_index(dev, child, con_id, 0, flags, label); -} - #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_OF_GPIO) struct device_node;