Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7025284ybi; Thu, 1 Aug 2019 02:05:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzm4koHdFqvf77E8pkt45R36VtJ85t2Pr2PvESQVy/X+zme9UvY/rCKd8lsA7z+RZZvggER X-Received: by 2002:aa7:8b55:: with SMTP id i21mr52322173pfd.155.1564650308006; Thu, 01 Aug 2019 02:05:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564650307; cv=none; d=google.com; s=arc-20160816; b=BIHTJOp8xbS00rIUZ1AVn1kXaZWGn9yOrVvzhKUZjQvGPfg3MaX5YlPUWMfc+GHpJZ qsNFeyhklUNxM1kRvuBkyOCXzPu/qaMTJpH5gAd21hDKPyy8yQVTw2Si8QM8auZAIW9C UvZHR1JmWf1Dks8WmyyLVuOb0sq8QUL84HgPQ3UQz6jHFZRiWsB2waNPIVChDA92nmy+ Rm0h4W2DZ2JrWFgCIQqg3LsZxaeF3Pk83BQ+ywKxFkqSwfNZeKriIsTcMe6FAzg00jVs MycxP5EPnYP0qUQ3LTZc6b5Q3ukLpnRpB0epDmooY6wnr4Xg4iIBaod75rg/SKtqxDjx ieYw== 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=fdxeIfIwQjnizThmOogykysiO+Uolc+902Byd8o72T8=; b=RGhMbPeDJPwoWneNpPDHh+qOSiae6/x+sRFfgSHTP7546F5Rbtpk7bck4fL90e3ofb 0XZX0EQh0GxlEZz1qX+/unDHC8HkvoG/fnR4iGTM7sJfyrtbh9tID6TSv9QkEnKkmEbE bVM9CnQtXCarC1UfsbqvCTwANjT6k7qVVt2Hedwu836W4b+MJvemRl03nbnYDRsog7Or iHDxffjf/yfN5JPPZ5My4UR+vfLPv4B93evn3W6dI2W/bCOYz81Rhe0XkEFrufJ9dzeE AQjidEb9qqmqQoO2ZES5zji5oWkH104+q9vZmwNDxBPvUfWcDseNDenHVjcYWY6YQ8oK Z5nA== 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 r200si31966461pgr.518.2019.08.01.02.04.50; Thu, 01 Aug 2019 02:05:07 -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 S1730527AbfHAISO convert rfc822-to-8bit (ORCPT + 99 others); Thu, 1 Aug 2019 04:18:14 -0400 Received: from skedge03.snt-world.com ([91.208.41.68]:46986 "EHLO skedge03.snt-world.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730229AbfHAISO (ORCPT ); Thu, 1 Aug 2019 04:18:14 -0400 Received: from sntmail12r.snt-is.com (unknown [10.203.32.182]) (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 1BCB46274CE; Thu, 1 Aug 2019 10:18:06 +0200 (CEST) Received: from sntmail12r.snt-is.com (10.203.32.182) by sntmail12r.snt-is.com (10.203.32.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 1 Aug 2019 10:18:05 +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; Thu, 1 Aug 2019 10:18:05 +0200 From: Schrempf Frieder To: Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , "Pengutronix Kernel Team" , Fabio Estevam , "NXP Linux Team" CC: Schrempf Frieder , Jiri Slaby , "linux-serial@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] serial: imx: Avoid probe failure in case of missing gpiolib Thread-Topic: [PATCH] serial: imx: Avoid probe failure in case of missing gpiolib Thread-Index: AQHVSEGkENWr6+HjfEGe5le+et6JcQ== Date: Thu, 1 Aug 2019 08:18:05 +0000 Message-ID: <20190801081524.22577-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: 1BCB46274CE.A071D 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, 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 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() will return -ENOSYS and cause the probing of the imx UART to fail. As the GPIOs are optional, we should continue probing in this case. Signed-off-by: Frieder Schrempf --- drivers/tty/serial/imx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 10db3e54ac9e..51714498dacf 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -2237,7 +2237,9 @@ static int imx_uart_probe(struct platform_device *pdev) timer_setup(&sport->timer, imx_uart_timeout, 0); sport->gpios = mctrl_gpio_init(&sport->port, 0); - if (IS_ERR(sport->gpios)) + if (PTR_ERR(sport->gpios) == -ENOSYS) + sport->gpios = NULL; + else if (IS_ERR(sport->gpios)) return PTR_ERR(sport->gpios); sport->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); -- 2.17.1