From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0234EC4332F for ; Mon, 28 Nov 2022 00:14:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xdlXOQyxWBGkORkc+SFfxDtqiRn+0VlnMGoLTy/4VNc=; b=NinGH9z+YGcG93 JPAAXPA1gc89W8kRN/ULF5o20GDR2riSLeUAhpZsULbePe17L2/zWjuA80EOOQrmipsIkq/WH1VqC j/8k+ilQdFOfLKvaYhmPy0GznH5SK9bOMkv7VH5F8FXwFncSDrYpD4nxBxD5SpRbb8bsFJ21u1xkX HniwdbyM8kkIluoRW64nUfqO54I4bk/JoC+DSwTfLBtn/SPiOMMpX56wkraoNK1zO1yIbE+tRChFV ClLWBuCXsfev9Imt8m1ivmgA+LUjVoFk9/tAFALErflbXEnH0SABoNiiax2+VgKaAB2J7Bbzb5yP9 kGRX6lti5O7GgOTvYYlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozRlr-00ELm0-3A; Mon, 28 Nov 2022 00:13:15 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozRln-00ELjf-Mb for linux-arm-kernel@lists.infradead.org; Mon, 28 Nov 2022 00:13:13 +0000 Received: (Authenticated sender: gregory.clement@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 643F0C0009; Mon, 28 Nov 2022 00:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1669594388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rCzuXF5jg/2X3rzSh+BtnoZiy+rOjSXQGCsNdbLLfdA=; b=g/9+syeAS/skbDrSeBTY9W7/vpJY7W194kkOP0Ib/tErppv+jFZATEx5Z2dAKvbC4KnI1R 46fJFopEmb7/O7AmOLtVa+enceSkmsptqDiS2uUGcBc7BhSLvGTcKzY5UP4VUojxiq/Y7F QrBQmv5C6y6HXPI5MmP/yeyePUSosELhy4Tq2VqPngIZAJk3IsnuyqpghEilEDHuwdnvi7 VtT+Zs+PnvoExwgQB/H4PyCcazqPf+ZPWnJSQh/6jrF8iHfcJ6wa/K6MUbbbjR+C9cXMhp ENfIL2WxcoWjGmHyfLU0qwK+dF8/xXCJAlAN01vfIzRPUjXi2YwQXgqWgfVwHQ== From: Gregory CLEMENT To: Dmitry Torokhov , Andrew Lunn , Sebastian Hesselbarth Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ARM: mvebu: switch to using gpiod API in pm-board code In-Reply-To: References: Date: Mon, 28 Nov 2022 01:13:08 +0100 Message-ID: <87lenw7x7v.fsf@BL-laptop> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221127_161311_908445_667AB992 X-CRM114-Status: GOOD ( 18.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Dmitry Torokhov writes: > This switches PM code to use the newer gpiod API instead of legacy > gpio API that we want to retire. > > Signed-off-by: Dmitry Torokhov Applied on mvebu/dt Thanks, Gregory > --- > arch/arm/mach-mvebu/pm-board.c | 28 +++++++++------------------- > 1 file changed, 9 insertions(+), 19 deletions(-) > > diff --git a/arch/arm/mach-mvebu/pm-board.c b/arch/arm/mach-mvebu/pm-board.c > index 7fa1806acd65..beec22e17e89 100644 > --- a/arch/arm/mach-mvebu/pm-board.c > +++ b/arch/arm/mach-mvebu/pm-board.c > @@ -8,19 +8,19 @@ > */ > > #include > -#include > +#include > +#include > #include > #include > #include > #include > -#include > #include > #include "common.h" > > #define ARMADA_PIC_NR_GPIOS 3 > > static void __iomem *gpio_ctrl; > -static int pic_gpios[ARMADA_PIC_NR_GPIOS]; > +static struct gpio_desc *pic_gpios[ARMADA_PIC_NR_GPIOS]; > static int pic_raw_gpios[ARMADA_PIC_NR_GPIOS]; > > static void mvebu_armada_pm_enter(void __iomem *sdram_reg, u32 srcmd) > @@ -90,27 +90,17 @@ static int __init mvebu_armada_pm_init(void) > char *name; > struct of_phandle_args args; > > - pic_gpios[i] = of_get_named_gpio(np, "ctrl-gpios", i); > - if (pic_gpios[i] < 0) { > - ret = -ENODEV; > - goto out; > - } > - > name = kasprintf(GFP_KERNEL, "pic-pin%d", i); > if (!name) { > ret = -ENOMEM; > goto out; > } > > - ret = gpio_request(pic_gpios[i], name); > - if (ret < 0) { > - kfree(name); > - goto out; > - } > - > - ret = gpio_direction_output(pic_gpios[i], 0); > - if (ret < 0) { > - gpio_free(pic_gpios[i]); > + pic_gpios[i] = fwnode_gpiod_get_index(of_fwnode_handle(np), > + "ctrl", i, GPIOD_OUT_HIGH, > + name); > + ret = PTR_ERR_OR_ZERO(pic_gpios[i]); > + if (ret) { > kfree(name); > goto out; > } > @@ -118,7 +108,7 @@ static int __init mvebu_armada_pm_init(void) > ret = of_parse_phandle_with_fixed_args(np, "ctrl-gpios", 2, > i, &args); > if (ret < 0) { > - gpio_free(pic_gpios[i]); > + gpiod_put(pic_gpios[i]); > kfree(name); > goto out; > } > -- > 2.38.1.431.g37b22c650d-goog > > > -- > Dmitry -- Gregory Clement, Bootlin Embedded Linux and Kernel engineering http://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel