Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1293998ybi; Fri, 2 Aug 2019 12:49:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLu9/LynyVQlscyFRw8SSWJDuC0r62GS6E3IgQW3lUoqJxihuNrgHKG6/qm6pgNMcsjThU X-Received: by 2002:a63:e62:: with SMTP id 34mr124103587pgo.331.1564775356177; Fri, 02 Aug 2019 12:49:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564775356; cv=none; d=google.com; s=arc-20160816; b=yy7YPjjjhUXl5w7p0HnIBxELOXM7fdxP/NRbtafmQWHJ6Tj9+VHk5tKXbB8mqgyiin 9QvzWTVObq1eluEIZhgghUMBjuydPPkL2HZnhYLhYANgFf1gWeIwrrV2niBNseNxYfKH 8AqOFKqog9LShz79Gkh3UyNX4KQe39MsLC2VIOBAET1QIdhSTdwJ8Fpk2XqPVzvzGIjf dsjQoT9ddYfludJsKoB+GC4xs8I5Jg0JnQUvKpKQDmQSdZjOHux7n6IYCZXAE6rxwjKE FXHR8LRvLnNciOzGXa+Rf5g9uM4ygq7vg1luzvh//1B/XXFVI20tspKnRmBJXvVCD16n xDuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=zmF0ps2c3pOr2mpKvVAAULxohUIFKfIGLFFdGZdqezQ=; b=ahbZU2AX8KDJl6Zor/1heR/jMY7Fa+8bikzNe6Mnhp09xVq79CJZxR5akM7CvBAOG1 ZsgFJJEPpBT4ecXkDNXRmhW1fLpWQ7iYmyth9Pho+JI56Ft6WhqqNJuig5w9eq3poJYj kvmmyYOp+4E+gPg9mxGRwqrLa6TIa07x+EwpldkGQAmUV2kuSet6WHetF47tyEGO5s6M sUU4tD6y6LgfN+YPNJsHbR9HhqtBUKVaXXZXstjM5JeGbcjzFNdKvbkgCfrk1AaOCPEG ZTGnUyWCcEtUHKOY80syoZQaQKFt9rpn5yQVYLalPTPgOKKSrYqa8Wy25JaVryb9wQiQ pRZA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a16si7022215pju.24.2019.08.02.12.49.01; Fri, 02 Aug 2019 12:49:16 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407273AbfHBKEz convert rfc822-to-8bit (ORCPT + 99 others); Fri, 2 Aug 2019 06:04:55 -0400 Received: from skedge03.snt-world.com ([91.208.41.68]:58060 "EHLO skedge03.snt-world.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390117AbfHBKEN (ORCPT ); Fri, 2 Aug 2019 06:04:13 -0400 Received: from sntmail11s.snt-is.com (unknown [10.203.32.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by skedge03.snt-world.com (Postfix) with ESMTPS id 7EEE7603D28; Fri, 2 Aug 2019 12:04:10 +0200 (CEST) Received: from sntmail12r.snt-is.com (10.203.32.182) by sntmail11s.snt-is.com (10.203.32.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 2 Aug 2019 12:04:10 +0200 Received: from sntmail12r.snt-is.com ([fe80::e551:8750:7bba:3305]) by sntmail12r.snt-is.com ([fe80::e551:8750:7bba:3305%3]) with mapi id 15.01.1713.004; Fri, 2 Aug 2019 12:04:10 +0200 From: Schrempf Frieder To: "u.kleine-koenig@pengutronix.de" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , "linux-imx@nxp.com" , Greg Kroah-Hartman CC: "linux-arm-kernel@lists.infradead.org" , "geert+renesas@glider.be" , Schrempf Frieder , Jiri Slaby , "linux-serial@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH v3 1/4] serial: mctrl_gpio: Avoid probe failures in case of missing gpiolib Thread-Topic: [PATCH v3 1/4] serial: mctrl_gpio: Avoid probe failures in case of missing gpiolib Thread-Index: AQHVSRmgIMto6YABN0CHGANRcY/fqA== Date: Fri, 2 Aug 2019 10:04:09 +0000 Message-ID: <20190802100349.8659-1-frieder.schrempf@kontron.de> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-originating-ip: [172.25.9.193] x-c2processedorg: 51b406b7-48a2-4d03-b652-521f56ac89f3 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-SnT-MailScanner-Information: Please contact the ISP for more information X-SnT-MailScanner-ID: 7EEE7603D28.AEAF5 X-SnT-MailScanner: Not scanned: please contact your Internet E-Mail Service Provider for details X-SnT-MailScanner-SpamCheck: X-SnT-MailScanner-From: frieder.schrempf@kontron.de X-SnT-MailScanner-To: festevam@gmail.com, geert+renesas@glider.be, gregkh@linuxfoundation.org, jslaby@suse.com, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org, u.kleine-koenig@pengutronix.de X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Frieder Schrempf If CONFIG_GPIOLIB is not enabled, mctrl_gpio_init() and mctrl_gpio_init_noauto() will currently return an error pointer with -ENOSYS. As the mctrl GPIOs are usually optional, drivers need to check for this condition to allow continue probing. To avoid the need for this check in each driver, we return NULL instead, as all the mctrl_gpio_*() functions are skipped anyway. We also adapt mctrl_gpio_to_gpiod() to be in line with this change. Reviewed-by: Fabio Estevam Signed-off-by: Frieder Schrempf --- Changes in v3 ============= * Move the changes in mctrl_gpio_to_gpiod() to a separate patch * Reorder tags Changes in v2 ============= * Move the sh_sci changes to a separate patch * Add Fabio's R-b tag --- drivers/tty/serial/serial_mctrl_gpio.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/serial_mctrl_gpio.h b/drivers/tty/serial/serial_mctrl_gpio.h index b7d3cca48ede..1b2ff503b2c2 100644 --- a/drivers/tty/serial/serial_mctrl_gpio.h +++ b/drivers/tty/serial/serial_mctrl_gpio.h @@ -114,19 +114,19 @@ static inline struct gpio_desc *mctrl_gpio_to_gpiod(struct mctrl_gpios *gpios, enum mctrl_gpio_idx gidx) { - return ERR_PTR(-ENOSYS); + return NULL; } static inline struct mctrl_gpios *mctrl_gpio_init(struct uart_port *port, unsigned int idx) { - return ERR_PTR(-ENOSYS); + return NULL; } static inline struct mctrl_gpios *mctrl_gpio_init_noauto(struct device *dev, unsigned int idx) { - return ERR_PTR(-ENOSYS); + return NULL; } static inline -- 2.17.1