Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6198995iog; Thu, 23 Jun 2022 13:29:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tZN/ji4zucuM3D10Z9MwW+a/CBfWThJsujLle5GaoAOU+EhXbTHnDFxjaN1d+B5qpfkyOC X-Received: by 2002:a65:6044:0:b0:3fc:674:8f5a with SMTP id a4-20020a656044000000b003fc06748f5amr8865470pgp.436.1656016176345; Thu, 23 Jun 2022 13:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656016176; cv=none; d=google.com; s=arc-20160816; b=G2sb/5Uo0SMXyFafV+kAYwdpGlnbtxTkVEJyrCcqCCuGoWJa6G/E3JiwDiRyPav4vP HzwcbROErwvDFkiCurfHwh9tWLomnMzMsy9CHUz5NGye6IZRnUDJA18PEb3nGgYkDa4u Hf92P3j7E9Uu7J+Eztgil8z1DtvAl7XtP1ibf/bknyRHPMVZniOad3Tl8u/rW7OQd7v+ K0fv9ODShJjqRdXiTMwpUfZHpnE1vX9hZhXcYgPwGpyXqu1UlXsC8PGI+5tdDwxNSD+w gNiCxNgArwP3x7vK4xbFtpKTn3qF3cC/lWt0eEt6tHh+i+p4Q74bMqQmuxWE4ywtxi93 p0rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=zRMgTfiTRJM8cqGhLQb7Ma/0FBHWawtIQwr0wSKP1yE=; b=tdf7LkwaLT02a9i/xVDH7oCI7LKmcl125WXOZFeBK5L1oLN3wkVFEGO2GmTQWltTNt /yLNEkaCkzXcJ7Egrzi5Xus1cH3RHiBg4Z+5tBiuVvo7XOmxuFgtlwYDIvviCVCl7U9g HEa4oWNJc6Fu2IyKxuA1IQpwmwW1pKkDJXOyYXxlmgHDsEmNYSHx2t6NCRQ5D4+5rSgP 0imSu+d0B0awAMfK4jHrntJWpC/v9v+ukywLpfXKHtkY65PAB9TFSYbHHWh7bzxIxQOm OhcxBGrkWYe3JxefBBDSlVDv2sqK7kt5F7gPai7xh0PnxG26fwhDYRfQbO593QmmYqd/ nEnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=QtTskdiV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z125-20020a626583000000b005253459815csi157815pfb.324.2022.06.23.13.29.23; Thu, 23 Jun 2022 13:29:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=QtTskdiV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229690AbiFWUT7 (ORCPT + 99 others); Thu, 23 Jun 2022 16:19:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbiFWUT6 (ORCPT ); Thu, 23 Jun 2022 16:19:58 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8164128723; Thu, 23 Jun 2022 13:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656015566; bh=7z0s+WHf2+v1qxr7m1rw9SjbVWQ/P3W5Q+Q8hQUhFL4=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=QtTskdiVf9SnLc0VDy0EIhIbvpMEzrUAMWnmUFkmkUODhMQ/kqzxpJQVzZsHpBX89 kCFS99QVz5o6YiBoT++oDJplAkjhZPv3AeBAgMSNGdOdtrU+5tCV/z6pnf/zKBNZiz cjYEO5nRUkXUaQEGqMKQ/UWOw5/htUwm/b9qIvUE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.0.33] ([46.223.3.134]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MplXp-1nJMNn1pnR-00q9Ow; Thu, 23 Jun 2022 22:19:26 +0200 Subject: Re: [PATCH 1/8] serial: core: only get RS485 termination gpio if supported To: Andy Shevchenko Cc: Greg Kroah-Hartman , Jiri Slaby , =?UTF-8?Q?Ilpo_J=c3=a4rvinen?= , Rob Herring , Krzysztof Kozlowski , Vladimir Zapolskiy , linux-arm Mailing List , devicetree , "open list:SERIAL DRIVERS" , Linux Kernel Mailing List , Lukas Wunner , p.rosenberger@kunbus.com, Lino Sanfilippo References: <20220622154659.8710-1-LinoSanfilippo@gmx.de> <20220622154659.8710-2-LinoSanfilippo@gmx.de> <2dda5707-6f13-6d33-863d-a88b89e88a88@gmx.de> <52ea773c-b5b0-fc4d-9b85-022676778af7@gmx.de> From: Lino Sanfilippo Message-ID: Date: Thu, 23 Jun 2022 22:19:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:R+h3v9u71I2BMWiuwJYl5ijLux5TSOJmiFNOdVkiUBhncJoBYBj Rpba1VLsz5PHFzMjtBa1BsosaVGf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g4VPw LTQYhDotdZYbL5pekeP1pQPhO4hzE1lwgIddL4xFyTM53QKp87QCUjCy2uHe+EwerKDk+Q4Pc mG2G2LhXOhjVdRcvPrft8flDrVE1WPnn4yaTcDMvwSgOHwz8QJ+nOOsWU1J4oUMTcv1ifjzJv GGnyzzdpKaRxCKD+qm2ozFYQsF1jxxzKgA5mZiiV/rdeNWOzpx0t5GUGpoxNGB0fVAzF128b4 NE6awCfFITxHdB11Xh0DxC0f2HgzcllNK69RBsP/yOJIux8TkGhahtS1Q== X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23.06.22 at 18:32, Andy Shevchenko wrote: >> >> Ok I see the point. So what about changing it to: > > You mean adding below after the existing code in the module? Right, to be more precise between getting the gpio and the error check: port->rs485_term_gpio =3D devm_gpiod_get_optional(dev, "rs485-term", GPIOD_OUT_LOW); if (port->rs485_term_gpio && !(port->rs485_supported->flags & SER_RS485_TERMINATE_BUS)) { dev_warn(port->dev, "%s (%d): RS485 termination gpio not supported by driver\n", port->name, port->line); devm_gpiod_put(dev, port->rs485_term_gpio); port->rs485_term_gpio =3D NULL; } if (IS_ERR(port->rs485_term_gpio)) { ret =3D PTR_ERR(port->rs485_term_gpio); port->rs485_term_gpio =3D NULL; return dev_err_probe(dev, ret, "Cannot get rs485-term-gpios\n"); } Regards, Lino > >> if (port->rs485_term_gpio && >> !(port->rs485_supported->flags & SER_RS485_TERMINATE_BUS)) { >> dev_warn(port->dev, >> "%s (%d): RS485 termination gpio not supported by driver\n", >> port->name, port->line); >> devm_gpiod_put(dev, port->rs485_term_gpio); >> port->rs485_term_gpio =3D NULL; >> } >> >> This would also be consistent to the warnings we print in uart_sanitize= _serial_rs485() for invalid >> RS485 settings. > > Probably it's okay, but I dunno we have much on this to gain. Users may = start > complaining of this (harmless) warning. I leave it to others to comment. >