From patchwork Wed Feb 8 09:24:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 93608 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2592194qgi; Wed, 8 Feb 2017 01:27:33 -0800 (PST) X-Received: by 10.98.19.12 with SMTP id b12mr24928452pfj.150.1486546053499; Wed, 08 Feb 2017 01:27:33 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b21si6628277pgg.194.2017.02.08.01.27.33; Wed, 08 Feb 2017 01:27:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932930AbdBHJZ4 (ORCPT + 25 others); Wed, 8 Feb 2017 04:25:56 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:36523 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753941AbdBHJY3 (ORCPT ); Wed, 8 Feb 2017 04:24:29 -0500 Received: by mail-wm0-f52.google.com with SMTP id c85so189413784wmi.1 for ; Wed, 08 Feb 2017 01:24:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HySfMZdp46lcPrJ4vmtyGzk4NKTi00ctAaYqlxsFHDo=; b=br5oVJDb8EafNprHQKFoy/tFzGCTFqfeEX/cS+/RYKyq6Bj1bOnkxJcVNzxAvPb5Ec Fz3mP+DRZ2ANecLMvCapWbb1gNaik1CTY4ILPYcYSpPR/MU231SmiGfsUHGMnKiNSVYR 2jDlkWBOhou4s2FAHK+uVHtZdIbDp4/OCSSEo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=HySfMZdp46lcPrJ4vmtyGzk4NKTi00ctAaYqlxsFHDo=; b=oNAuLQwYtIkgvbj5gv2Pd4dSzKpxeyE9YbUAqIRFeoiBmDSFg4JbD30e9AVwxuWpzw vLlvavLDsvWeqVQk9rtBTIgtTR8bS3phSMa5Kh+y/uw31x13z1iuzF6ur9WlToYWnh1v CFDrgOJ6cHRdYP+UD/cqJQGJjVMRy2uDWtlMiUJyXrOaouI47Ga86q03MPuoxcX8tlXa yk5qZcduSmi2jVGo1U/dkqdsOqtGxH488QBnDxkKf2Oiwu1aP7iWlW0TaKaq/tGGzFck FgA35OCgUX5/7n8I258283sCwzQ4w05UrxUFzIzkwVeyrrctLhbemHLQO/sSnAxwdjXI +PrQ== X-Gm-Message-State: AMke39ktwCVy9KINWDiaGmwlb+iaTcdp/4O54bIfcKZgMq6cBy6ZdG3OgaHmCWOPOCRedFok X-Received: by 10.28.9.148 with SMTP id 142mr15954477wmj.24.1486545868157; Wed, 08 Feb 2017 01:24:28 -0800 (PST) Received: from dell (host81-129-172-224.range81-129.btcentralplus.com. [81.129.172.224]) by smtp.gmail.com with ESMTPSA id k43sm11847781wrc.46.2017.02.08.01.24.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Feb 2017 01:24:27 -0800 (PST) Date: Wed, 8 Feb 2017 09:24:25 +0000 From: Lee Jones To: Stephen Rothwell , Greg KH Cc: Linus Walleij , linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, Boris Brezillon , Alexander Stein , Andy Shevchenko Subject: [PATCH] serial: st-asc: Use new GPIOD API to obtain RTS pin Message-ID: <20170208092425.azqkx3nwf4jhsfz5@dell> References: <20170208161113.1b597c01@canb.auug.org.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170208161113.1b597c01@canb.auug.org.au> User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commits mentioned below adapt the GPIO API to allow more information to be passed directly through devm_get_gpiod_from_child() in the first instance. This facilitates the removal of subsequent calls, such as gpiod_direction_output(). This patch firstly moves to utilise the new API and secondly removes the now superfluous call do set the direction. Fixes: a264d10ff45c ("gpiolib: Convert fwnode_get_named_gpiod() to configure GPIO") Fixes: b2987d7438e0 ("gpio: Pass GPIO label down to gpiod_request") Fixes: 4b0947974e59 ("gpio: Rename devm_get_gpiod_from_child()") Reported-by: Stephen Rothwell Suggested-by: Boris Brezillon Signed-off-by: Lee Jones --- drivers/tty/serial/st-asc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.9.3 diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index bcf1d33..c334bcc 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -575,12 +575,13 @@ static void asc_set_termios(struct uart_port *port, struct ktermios *termios, pinctrl_select_state(ascport->pinctrl, ascport->states[NO_HW_FLOWCTRL]); - gpiod = devm_get_gpiod_from_child(port->dev, "rts", - &np->fwnode); - if (!IS_ERR(gpiod)) { - gpiod_direction_output(gpiod, 0); + gpiod = devm_fwnode_get_gpiod_from_child(port->dev, + "rts", + &np->fwnode, + GPIOD_OUT_LOW, + np->name); + if (!IS_ERR(gpiod)) ascport->rts = gpiod; - } } }