Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3803664rwb; Fri, 30 Sep 2022 08:31:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7KrG7TIFaEcG0ZkUGNjSnKm9DPpe3WxyD+6jk1Qy8UJHKD0NE00SvbhnDhu0Mdic520M+x X-Received: by 2002:a05:6402:2554:b0:450:28d2:2152 with SMTP id l20-20020a056402255400b0045028d22152mr8319591edb.303.1664551896998; Fri, 30 Sep 2022 08:31:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664551896; cv=none; d=google.com; s=arc-20160816; b=qzm1F7bN22QmLkNHjyVIXpSDqn5giaoCe57GXPiMZOgMal8N9CvBffIe4yqUb54+/k RZNkv/Z041wRgHuds3jBtbFUBrh/4hpjHWdBGF7k9TzMBHtIn+dF3OGw3hgtUf+s5CGM +PG6pUCDyWtZh5eCY5fiaLDECWnQr2C+/uhMWaUWK4f3qL1wVB/6qRzegzE5l8TaaIy9 AnsvixbHdO3h1gPsopdkGM+IgQ2lOmo58lzjDiD3HXfBvnzwae8GU1hBEPi+pcQw7i+S Y0j04fn4n+ugRa5owmISK7RF5hflN6fhHCbfVnRVn5uAbpKGauD5TwE2yyhCCJ8HCCek ngSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=4Yw00D1i1iH+EymJCk56ZAid0vtMoD/Gh5wJSEhcCV4=; b=OPPu7ZunPvPQ+A2Ezpb8zM9rfrb3UENJdMAUvSGpwVKmWeJvZJ24AUYLfAHvLcLEOq xqd3+xsCaZbqUMP+8Hhgb+SEO7/uFDS3R/XvohCUA6LqdnQCX7ZO0Yw+bhiVdBKvH9Pb byg2fGYG9I9MG5vJFErC2jKRhZvCyJ5E1lI2I1cc2oU7fdtjgFOW/oEvbEYgSof/1nXz BrdzjWmdfR1ckBhXSQ1+KRvAII8JvQTWI398ArtTdsmTJl6gB93GV3uBJjbsvPMHUNlG DIQoEo9FsDARA6fkQgr1SwL9ry8QITR/+7KcmD+uSHw/I4wC3luwaOZWILa/sbooH90z zBog== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a3-20020a50c303000000b00456f78e9ff6si1946066edb.514.2022.09.30.08.31.10; Fri, 30 Sep 2022 08:31:36 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231638AbiI3PQd (ORCPT + 99 others); Fri, 30 Sep 2022 11:16:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231810AbiI3PQU (ORCPT ); Fri, 30 Sep 2022 11:16:20 -0400 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5EF5011DFEF; Fri, 30 Sep 2022 08:16:17 -0700 (PDT) Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1oeHkN-0003TJ-00; Fri, 30 Sep 2022 17:16:15 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 14E97C0D1E; Fri, 30 Sep 2022 17:15:25 +0200 (CEST) Date: Fri, 30 Sep 2022 17:15:25 +0200 From: Thomas Bogendoerfer To: Dmitry Torokhov Cc: Linus Walleij , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC/PATCH v2] MIPS: pci: lantiq: switch to using gpiod API Message-ID: <20220930151525.GC12989@alpha.franken.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE 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 26, 2022 at 09:59:00PM -0700, Dmitry Torokhov wrote: > This patch switches the driver from legacy gpio API to the newer > gpiod API. > > Signed-off-by: Dmitry Torokhov > --- > v2 - actually compiles. I have some doubts... > arch/mips/pci/pci-lantiq.c | 27 ++++++++++++--------------- > 1 file changed, 12 insertions(+), 15 deletions(-) > > diff --git a/arch/mips/pci/pci-lantiq.c b/arch/mips/pci/pci-lantiq.c > index 1ca42f482130..377b4a2577e1 100644 > --- a/arch/mips/pci/pci-lantiq.c > +++ b/arch/mips/pci/pci-lantiq.c > @@ -9,11 +9,11 @@ > #include > #include > #include > +#include > #include > #include > #include > #include > -#include > #include > #include > > @@ -62,7 +62,7 @@ > __iomem void *ltq_pci_mapped_cfg; > static __iomem void *ltq_pci_membase; > > -static int reset_gpio; > +static gpio_desc *reset_gpio; /local/tbogendoerfer/korg/linux/arch/mips/pci/pci-lantiq.c:65:8: error: unknown type name ‘gpio_desc’ static gpio_desc *reset_gpio; > static struct clk *clk_pci, *clk_external; > static struct resource pci_io_resource; > static struct resource pci_mem_resource; > @@ -123,17 +123,14 @@ static int ltq_pci_startup(struct platform_device *pdev) > clk_disable(clk_external); > > /* setup reset gpio used by pci */ > - reset_gpio = of_get_named_gpio(node, "gpio-reset", 0); > - if (gpio_is_valid(reset_gpio)) { > - int ret = devm_gpio_request(&pdev->dev, > - reset_gpio, "pci-reset"); > - if (ret) { > - dev_err(&pdev->dev, > - "failed to request gpio %d\n", reset_gpio); > - return ret; > - } > - gpio_direction_output(reset_gpio, 1); > + reset_gpio = devm_gpiod_get_optional(&pdev->dev, "reset", > + GPIOD_OUT_LOW); > + ret = PTR_ERR_OR_ZERO(reset_gpio); /local/tbogendoerfer/korg/linux/arch/mips/pci/pci-lantiq.c:128:2: error: ‘ret’ undeclared (first use in this function) ret = PTR_ERR_OR_ZERO(reset_gpio); Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]