Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp837550imk; Sun, 3 Jul 2022 10:04:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u6o7WSAvgCtj0KIVWkx8qF3HKasVBxiqnkqml+RDIOvIi+DLXdqv0t0XKiije8Dm+JJffP X-Received: by 2002:a17:906:2b45:b0:726:931a:cb5f with SMTP id b5-20020a1709062b4500b00726931acb5fmr24852092ejg.767.1656867869649; Sun, 03 Jul 2022 10:04:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656867869; cv=none; d=google.com; s=arc-20160816; b=aFXc6VdIwXQBJW6MtkULew4o/1KTvXkaVF4DubspizZm3GB4lEJQygggVfXHC7LS4N 9Z9UIQuO+lUHcyRJvnZiPVC4w6Swk0GNHrhT9CEvQybCtcsfb65HPV9phCjgGbF1TuSu q2AFmOrnfxKxO4O8wl0dAiPXFWGsgGAUUd3pzNh4C0bNM9kA67cHPzKcL4FfkmU37ml1 xxqQENyN25HGm2/oiQj+cE0kZEdkqSt5wsNVaq6pP1RG1oMsjCyD7lTbHrUx/Yv6G0gY L+knRP9lKvWcmMRgIb80IsrlH2dt6IbzFqTInNMTeud4BEaY+2burleTzwVavJe7j1Yo ur2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jkKzvX9K2yUOdQWW1Ju0XywTrAt4odrCEHF4kNehvBc=; b=S4/SBBrqwqQEK5V7RuwxlBiKkSsxewsGa6VO18koKSX1gL72iuDdH+Ce+CeihraGUq h1RL3cyjv6rUyCqjMm4qEFL650HnDDTg828MUeZckEtCAOZDapR3egocS/fhKtX/3wix a5z6QfDO9On80IbRhqb3RBpt2zts5n0tB16CGmh085tvKML2oXfkKQxGSFTElpikGUEr drHeabHLC1+yBcA1xHLoYspyhVtNha+K5uVANvBQahdKEBum6cTQGN7wQRIaf8YLgVv3 u1nv3OSMOFsIkONB9DkJ03YlzG7Agh5EOlbeuRNHW5obmdVlDCGY3MLzacnCE9L4C+31 NYFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=UsQY0Eai; 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 hq22-20020a1709073f1600b00718c1dc9100si15517424ejc.786.2022.07.03.10.04.04; Sun, 03 Jul 2022 10:04:29 -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=UsQY0Eai; 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 S232813AbiGCRC2 (ORCPT + 99 others); Sun, 3 Jul 2022 13:02:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232438AbiGCRB6 (ORCPT ); Sun, 3 Jul 2022 13:01:58 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7936E624F; Sun, 3 Jul 2022 10:01:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656867691; bh=jkKzvX9K2yUOdQWW1Ju0XywTrAt4odrCEHF4kNehvBc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=UsQY0Eai123tThH18I4L+xXnQcNKmJgvkHWxF8zb4fdxOkrVUwgCizd6xALGqoQq5 1spIcHUfMHUlCcc30Axgx7q+OxCdmdaDt14Z1Pp3DQ9bPq6sh8jxy7nD/GQSOUoKcv DmyjNLzs403GFvdxsFfK8t1JpRu9sBolhFuI5kb8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([46.223.3.210]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MTAFh-1o2mQ805Dr-00Uduo; Sun, 03 Jul 2022 19:01:31 +0200 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: ilpo.jarvinen@linux.intel.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, andriy.shevchenko@linux.intel.com, vz@mleia.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo Subject: [PATCH v2 3/9] serial: core: move sanitizing of RS485 delays into own function Date: Sun, 3 Jul 2022 19:00:33 +0200 Message-Id: <20220703170039.2058202-4-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220703170039.2058202-1-LinoSanfilippo@gmx.de> References: <20220703170039.2058202-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:qyH35UB6OgK9aAsVjM0R4uFEO6UXYWIXW/DoeHKNA3Jzn0ON7NF HlAakeLXfnswVxGUTkH0ckJFuTnc+GsUF8aIYaQ7io/vr3twlSjDNY3Wx4d4v+TQn45uEER ZEHHM141I6Px3YC7/bZyXYZp/b4YwMH6iPkrbwd52ZGMdVAg3c5t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DRbXRkENHLoG/a6blFNyh8Kcs2Nhd4IQqVy3bNyGdsyIFqgK4422F 0wA36G1RHePgcNP86hn6/QEQziIrGbx/i+IaKTJ59qU6BrIe6MBZ56vjbu6ll3bDU4lyDW6aV h7Ua8nDsH1H19zG06xBk2LDhaGL5he2BflcVjwwrf+jPZ0WsImSZ4JgsQ== X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,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 RnJvbTogTGlubyBTYW5maWxpcHBvIDxsLnNhbmZpbGlwcG9Aa3VuYnVzLmNvbT4KCk1vdmUgdGhl IHNhbml0aXppbmcgb2YgUlM0ODUgZGVsYXlzIG91dCBvZiB1YXJ0X3Nhbml0aXplX3NlcmlhbF9y czQ4NSgpCmludG8gdGhlIG5ldyBmdW5jdGlvbiB1YXJ0X3Nhbml0aXplX3NlcmlhbF9yczQ4NV9k ZWxheXMoKS4KClNpZ25lZC1vZmYtYnk6IExpbm8gU2FuZmlsaXBwbyA8bC5zYW5maWxpcHBvQGt1 bmJ1cy5jb20+ClJldmlld2VkLWJ5OiBJbHBvIErDpHJ2aW5lbiA8aWxwby5qYXJ2aW5lbkBsaW51 eC5pbnRlbC5jb20+Ci0tLQogZHJpdmVycy90dHkvc2VyaWFsL3NlcmlhbF9jb3JlLmMgfCA0NiAr KysrKysrKysrKysrKysrKystLS0tLS0tLS0tLS0tLQogMSBmaWxlIGNoYW5nZWQsIDI2IGluc2Vy dGlvbnMoKyksIDIwIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2RyaXZlcnMvdHR5L3Nlcmlh bC9zZXJpYW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