Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4967191iog; Wed, 22 Jun 2022 09:13:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1siIoN0sjjlLVxADPpEPzXOh2lN0rjmQ9ansjsvCL1AZyAlKn2/Zmb9s/XBj6S6kPL9KVtB X-Received: by 2002:a17:907:3dac:b0:722:e6ab:8d9 with SMTP id he44-20020a1709073dac00b00722e6ab08d9mr3876511ejc.20.1655914382324; Wed, 22 Jun 2022 09:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655914382; cv=none; d=google.com; s=arc-20160816; b=XK1lSJZwQK3UIV47XiJNIzN3Z0w+C91j+l1kgVBYrA6EZyoAWcozKm7cKKKaQTOjsI y3lyyHP4ATSbC2NH2bPQQKzXTADDlDbfhQPsByAiRNXS83wbmHdhVpW9F//3lj5GA8ks 6KOaSRKGCkWT+HzR0iEO2TJNw85ODH97AREeuDGCt/dhAUOd/EVpqMGzod0fv2O0ru8I 9uB6WWjKImy3jhXBxQb8HeCe20/6Uaukr5wyaU1G9BfsVPNi7+3Ucv+WBr/L7QcxykA9 +e8k4DpiVmHvgQMIZkXIQ6638rAFTZ0KVfK8jqWKXwmz6rPWdZ8xrpQMjabGyLZoHZGP jQrw== 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=Rq3KFvxDtHALFh/DnfsS+evHIUI8vMe3n1/DQWqfHUk=; b=SHg3jIcJiKU4XCK8BoG4CpLZK3tLL681fMegISpf8ox8E3tETnAHOppTCig60TFpoJ t91t1+iQ3WUMctqz+iNjI0MfKwW/k199GxdLS2SSecy9zCuHQwGR66P5K0gS6D0o2UW9 N2mtZ3L05WOTYhQ7R/9n2q4YkrJ1pcqxYBKwZfdxlz/VhQ0KUBJMCqPBs6ablkIcBq9y vNZW2DiI4mDTFh4EM+sNT42L2ETsJ/x5ysebgcXLeLYogPJTtpeboP78phnt6UBWVcPH XhtOcCakdeTSxedQfJJUQOVawxaSzkCA5k1P/QlpFxwEskQyYmFR5L2gIAIqCH8ZuqHG Fudg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=XZgcm2aB; 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 d26-20020a056402401a00b004359684a74fsi5811235eda.564.2022.06.22.09.12.36; Wed, 22 Jun 2022 09:13:02 -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=XZgcm2aB; 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 S1359544AbiFVPsD (ORCPT + 99 others); Wed, 22 Jun 2022 11:48:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359515AbiFVPrs (ORCPT ); Wed, 22 Jun 2022 11:47:48 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAAF13DDFA; Wed, 22 Jun 2022 08:47:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1655912840; bh=Rq3KFvxDtHALFh/DnfsS+evHIUI8vMe3n1/DQWqfHUk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=XZgcm2aBHskXKxiq1sdoU/43+QwTkbYSXsznvKnZHkWP4CKG+g7l3NCchoiBEIASO B8/Vby+1wlyuEGZz+T0B7DidPFM+D4hvQg39WtlLzGMjgcqMhcv+coNCt8+hT7tYXT e2fKbQAEGRU5lD+ltxxhFJqOb2QaYQCPFtxuIE5w= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([46.223.2.22]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MpUZ4-1nL1am2Tt6-00pvse; Wed, 22 Jun 2022 17:47:20 +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 3/8] serial: core: move sanitizing of RS485 delays into own function Date: Wed, 22 Jun 2022 17:46:54 +0200 Message-Id: <20220622154659.8710-4-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220622154659.8710-1-LinoSanfilippo@gmx.de> References: <20220622154659.8710-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:dCXH7+GWeAl4LLMvcxAw/fQZwalG9+Q0N9n2K5X3mltot8aufOr a8QPrBg2BcpkehxEVEfYsj+RupRw8ld0OVbpgqKeJ81SaOV9GahIzZhkoM2P0rT3F4OTHVe n0uYYWPpwxrZ0dPM5Pr/CLtk+ipDxGZuiYItznVAa/DyR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2MWX631NOaGQk1PXbnuc9zv89L1FgFl6T2c2iahVicWl7Ep916xuHV/6WjskNvb+GG0 Y+58/8YDEY9jPkSWX5rYiGo6anGAb7fnSHbL05m3OCP5YgmajBDo2nYnc098DMtvnUd7qykqZ TSJWhF3uQgRTZqa/BJVBTHXcpsYcEv7CH/aXxXGNR46g9o/q1lYYJ+nlw== X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,MIME_BASE64_TEXT,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+Ci0tLQogZHJpdmVycy90dHkvc2VyaWFsL3NlcmlhbF9jb3JlLmMgfCA0NiArKysr KysrKysrKysrKysrKystLS0tLS0tLS0tLS0tLQogMSBmaWxlIGNoYW5nZWQsIDI2IGluc2VydGlv bnMoKyksIDIwIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2RyaXZlcnMvdHR5L3NlcmlhbC9z ZXJpYWxfY29yZS5jIGIvZHJpdmVycy90dHkvc2VyaWFsL3NlcmlhbF9jb3JlLmMKaW5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