From patchwork Sun Mar 5 12:54:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 94908 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp996222qgd; Sun, 5 Mar 2017 04:54:31 -0800 (PST) X-Received: by 10.84.213.137 with SMTP id g9mr18390167pli.114.1488718471492; Sun, 05 Mar 2017 04:54:31 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2si9785663plj.119.2017.03.05.04.54.31; Sun, 05 Mar 2017 04:54:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752490AbdCEMyb (ORCPT + 2 others); Sun, 5 Mar 2017 07:54:31 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:38823 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752425AbdCEMya (ORCPT ); Sun, 5 Mar 2017 07:54:30 -0500 Received: by mail-wm0-f46.google.com with SMTP id t193so45426083wmt.1 for ; Sun, 05 Mar 2017 04:54:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=iIQ5HPe6FFdBHmYDNL7nLeNedq373HN+sbU2qUnqEJg=; b=QAHz1HCo0Fjly4qXtoNue6U2F0XEskG4nW4YTAAcgF/hzsFbyACmok9kLWEyaSt4HH OjfATmMWcQz2bv0sHx/GGYAlGW/hKYccrlFokPdGlO+z4eDgXBYarPqjuQs/7aJ/HqmQ FJehtJypFmw4NSv1YCLK7F4a7zAe0rO2iRTAw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iIQ5HPe6FFdBHmYDNL7nLeNedq373HN+sbU2qUnqEJg=; b=hyJZ2L4hPpbPc4DCE6rSFgSw1nSexdxYYd6FOvVSQTJDsjB6O5osOGFBiNrMx+N/e/ aATp0szLoAGdfGe7B0EykgZSxNNNDhP+5efbwzAP3Jwsc6CB2BfCVtPVH0kk54PjXSeZ Zhn9aYceUiiCz0c8/X0ppgPJhGwSbZJ62aGCTo9llVry1Pwf0uyc9c5mCHoks8KbcD5N jIVgc18CFMxAvjjj8emsncYtrVtErX38LRQ9KuyF/0xPAFwe65H6iT40C5JrOKjRH8qF 28t22Gr/SYWVU1FndJsHEakLOpQyg0yG7mxe8Z7+SOQKLZPYX3sLXG4Uq7iikjUMiOpS LbKg== X-Gm-Message-State: AMke39m1dy7u4NoUJN+zrlWJO+vZgRDHr4lml5dZp049AgcoWsy0nh7fkfukVR0iLrJ92ozr X-Received: by 10.28.182.10 with SMTP id g10mr10240633wmf.123.1488718468792; Sun, 05 Mar 2017 04:54:28 -0800 (PST) Received: from genomnajs.local (catv-80-98-18-187.catv.broadband.hu. [80.98.18.187]) by smtp.gmail.com with ESMTPSA id o52sm22970762wrb.51.2017.03.05.04.54.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Mar 2017 04:54:27 -0800 (PST) From: Linus Walleij To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Lee Jones Cc: Linus Walleij Subject: [PATCH] serial: st-asc: Use new GPIOD API to obtain RTS pin Date: Sun, 5 Mar 2017 13:54:12 +0100 Message-Id: <20170305125412.24373-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org From: Lee Jones 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. Reported-by: Stephen Rothwell Suggested-by: Boris Brezillon Signed-off-by: Lee Jones [Also drop the header file dummies that only this driver was using] Signed-off-by: Linus Walleij --- Greg: please go ahead and merge this for the -rc:s, or toss in an ACK and I will merge it as a GPIO fix. THANKS for pointing out this painless way to phase out APIs. --- drivers/tty/serial/st-asc.c | 11 ++++++----- include/linux/gpio/consumer.h | 16 ---------------- 2 files changed, 6 insertions(+), 21 deletions(-) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Greg Kroah-Hartman diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index bcf1d33e6ffe..c334bcc59c64 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; - } } } diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index 2484b2fcc6eb..933d93656605 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -143,15 +143,6 @@ struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev, struct fwnode_handle *child, enum gpiod_flags flags, const char *label); -/* FIXME: delete this helper when users are switched over */ -static inline struct gpio_desc *devm_get_gpiod_from_child(struct device *dev, - const char *con_id, struct fwnode_handle *child) -{ - return devm_fwnode_get_index_gpiod_from_child(dev, con_id, - 0, child, - GPIOD_ASIS, - "?"); -} #else /* CONFIG_GPIOLIB */ @@ -444,13 +435,6 @@ struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev, return ERR_PTR(-ENOSYS); } -/* FIXME: delete this when all users are switched over */ -static inline struct gpio_desc *devm_get_gpiod_from_child(struct device *dev, - const char *con_id, struct fwnode_handle *child) -{ - return ERR_PTR(-ENOSYS); -} - #endif /* CONFIG_GPIOLIB */ static inline