Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6374786ybi; Wed, 29 May 2019 07:00:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlkZDlLoHOqd4duB66hDEgOT2S14ND0WFP2WURvqgZCFlVTLGc8Zcf4kVTfXO3LG2iIbPI X-Received: by 2002:a65:534b:: with SMTP id w11mr139615734pgr.210.1559138446056; Wed, 29 May 2019 07:00:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559138446; cv=none; d=google.com; s=arc-20160816; b=iWkzd/QonU7dpzuh+v+JQ6/HqxsaROeYr7m9kLDlQhoMEsI9ir9t6ps2G0+3+AJbxk GjNPzC0WqooeZPCaXpB2ltZ+OkG/UdvRp+knD1mzjC43ajhKrQd9VLTUxzjesTkesP3m 0qzmxXQEBzjQxwciDwQDu0m5fFavhBlRjJZuvS++G49+KzJEhTfQqXkT1De4F7oJNKkX VVBKBybpLbP1GeY7dXv+XxeBPkVrNfWWEmt19+ezx1sIi9n9eiuEsakRwJVURhyk35DQ OQjEU401+gTJTHR4HkJZ4Y/nuA1i6sSlBDQppq55FX0zZUm+Ba3P5Y4Vl/hW+jfEXJ8x 5iDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id:from :references:cc:to:subject; bh=MlFWohNuiiQuSsYgaLF97m5cJhzgj41SO5gfjLy3p90=; b=mS4B2W43eZNpyaViYaup2pNfMvgICAAcaE73Z+wxl2+qVZaGbXi8LjcPl0p24IwISL PoUgnQfXaWKVp5ZD+FBh+w0xAOvCA0Kyy1hy9Fe9nFAv2CArliXXe5IH5EOCaq73lh/N JxXIqLQr1qQWsRXDDo4lgfrAzLbmo1pOIlhKuhQh/UtRanCgfq5e7fTC2dfEcQABVrEb Wo48eFc0xxR/8r2vwxiSX7zae7J0XDhaQhzLtb+4rYufciiZEjXlnb83L075/EU+cFia epaRmkNhsciRD5VsI9SMDOxbYmJUsh4HdLeb6VldTO94KfAl4/wlGx0jvjYC6v2qfdq1 iqXg== 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 v30si29836340pfi.148.2019.05.29.07.00.28; Wed, 29 May 2019 07:00:46 -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 S1727412AbfE2N5m (ORCPT + 99 others); Wed, 29 May 2019 09:57:42 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:25484 "EHLO mx1.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726702AbfE2N5l (ORCPT ); Wed, 29 May 2019 09:57:41 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id AEAC050261; Wed, 29 May 2019 15:57:39 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id Nea8omml6Tf8; Wed, 29 May 2019 15:57:33 +0200 (CEST) Subject: Re: [PATCH 1/2 v3] serial: mctrl_gpio: Check if GPIO property exisits before requesting it To: Johan Hovold Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Mika Westerberg , Andy Shevchenko , Yegor Yefremov , Greg Kroah-Hartman , Giulio Benetti References: <20190527111805.876-1-sr@denx.de> <20190529134435.GR568@localhost> From: Stefan Roese Message-ID: <4e45b298-78bf-c2a0-fcbe-45c10674990f@denx.de> Date: Wed, 29 May 2019 15:57:31 +0200 MIME-Version: 1.0 In-Reply-To: <20190529134435.GR568@localhost> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29.05.19 15:44, Johan Hovold wrote: > On Mon, May 27, 2019 at 01:18:04PM +0200, Stefan Roese wrote: >> This patch adds a check for the GPIOs property existence, before the >> GPIO is requested. This fixes an issue seen when the 8250 mctrl_gpio >> support is added (2nd patch in this patch series) on x86 platforms using >> ACPI. > >> Signed-off-by: Stefan Roese >> Cc: Mika Westerberg >> Cc: Andy Shevchenko >> Cc: Yegor Yefremov >> Cc: Greg Kroah-Hartman >> Cc: Giulio Benetti >> --- >> v3: >> - No change >> >> v2: >> - Include the problem description and analysis from Mika into the commit >> text, as suggested by Greg. >> >> drivers/tty/serial/serial_mctrl_gpio.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c >> index 39ed56214cd3..cac50b20a119 100644 >> --- a/drivers/tty/serial/serial_mctrl_gpio.c >> +++ b/drivers/tty/serial/serial_mctrl_gpio.c >> @@ -116,6 +116,13 @@ struct mctrl_gpios *mctrl_gpio_init_noauto(struct device *dev, unsigned int idx) >> >> for (i = 0; i < UART_GPIO_MAX; i++) { >> enum gpiod_flags flags; >> + char *gpio_str; >> + >> + /* Check if GPIO property exists and continue if not */ >> + gpio_str = kasprintf(GFP_KERNEL, "%s-gpios", >> + mctrl_gpios_desc[i].name); > > Where's the corresponding kfree? Its missing. I'll add it in v4. Thanks, Stefan