From patchwork Thu Nov 10 00:44:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 17876 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp646430wru; Wed, 9 Nov 2022 16:46:23 -0800 (PST) X-Google-Smtp-Source: AMsMyM7O1QJ0+ct14YPq05mltSvC/QmK7/dOkhkh/daflc86bJ9D7KubBuJehwgLml0KVAcwU/Cd X-Received: by 2002:a63:93:0:b0:470:9d3:7d48 with SMTP id 141-20020a630093000000b0047009d37d48mr34105276pga.425.1668041182830; Wed, 09 Nov 2022 16:46:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668041182; cv=none; d=google.com; s=arc-20160816; b=QEL7eFDmQlfV90jMxvZXWvFvNE/WaLcGNENf+3hbGRM0jsawmaTGD+qxFvYbb5fBmH IDhIZGEFTAZxpGKLYus710A2HpGdlelcxmrAgQCaueXC8OlxvTpxDU+MnSaQO0O/qVSd /Irc6uWaq4PIHYtEKWTVAwEl+Q2JZEN9USVV3mtw6SZCCVOl1Q3QRaOMuvLTWNZKIcaq 6uW2H8ZjWgdTUrdryQfqMNVggf2NJ5cD83zb2WTEy0Iec1g+/Zab5Fr3Rq2ivG+tgPV2 URXg9T2AN+/duI5EJQD8M6rg4tjcWEetU80RKy1p812pBTvNk8wJ0ER43lUDhZGhyV5a 4o5w== 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=IQFfyExI23+erN827zqnus+ZsfTP6ThOACFwJyPon2s=; b=XbUc9YWHJ7S81iDvvkoy9NXFxJ6nlv4t75tG/aALRnl81suFf8GfRFEyGNgu0HkVJ7 bRcg/5w+ZySX2bUJrkfkYrGNDyqdKzchsn2edEKWgo0u+Si2tlgYUh/kcNdmoLEIvCkd BKtzPciwELbjzVOmN4X6NDzOauXp5oOAPWO1ymhBIIh25VLgpfcZv1t45gmu8WGo6FuG ew3obiJkfK54xfHxe58J+J2S04yMpckwQ6yVHB9pF+jLBm0TM909Azga7K/FVqOEBDwQ txkGYb/XWPFG+9X9uaSgSDIcvbRFVd6nRxV+ydhmy45ipIT2GEUnWare2Gmgla2vLxrK FGAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="SNYDT/SM"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e18-20020a630f12000000b0041bfb11f138si18776052pgl.442.2022.11.09.16.46.09; Wed, 09 Nov 2022 16:46:22 -0800 (PST) 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=@gmail.com header.s=20210112 header.b="SNYDT/SM"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231789AbiKJApH (ORCPT + 99 others); Wed, 9 Nov 2022 19:45:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231613AbiKJApC (ORCPT ); Wed, 9 Nov 2022 19:45:02 -0500 Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A819210B4B; Wed, 9 Nov 2022 16:45:01 -0800 (PST) Received: by mail-qv1-xf35.google.com with SMTP id u7so408116qvn.13; Wed, 09 Nov 2022 16:45:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IQFfyExI23+erN827zqnus+ZsfTP6ThOACFwJyPon2s=; b=SNYDT/SMvRejywXSJ+dWJo3s/8vCoANtLeDa+6OQcWqhZi1Kx5sbK/a5LZkBm25UQE KVLQ4gxfOgmjYbr0xkDZX8CVB4DR4uPV5OuqDcRNRcuZnH6EUTYCpqqCU0VDZFhnDpoQ 246T7+gVZx8TFnIlo9V/v2pOMiJqgCSnalSeq9zMwZyknIcWz1RA71+uOlPgH2ggHjKc qWf59WQRQeWFl+y6ik1M2CMd+WQEWm7GEGwnSyqZkZW8ElZTLMFHXPv8Ia/2jJzo/d0t TDV42PmGbsn5C4mVHq9zVKHKcVLTUu8FtMOYnEuz9H9xS1lODgDuV1nXx+7DuNDGsZTA gJWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IQFfyExI23+erN827zqnus+ZsfTP6ThOACFwJyPon2s=; b=Cu8VRwfONfDvGnsDSXpN0+yz0wbrfiUKhm4PMQ51BiPpoOK+ztCkKSDmnISAX4gXOa k5XaXW3t77uuvR2kLJxjbm5lfwx8CCtlfPN9UnTLM/3iip+c4onnnGogpZHRj8h/jXNK NeWqNz8tpW6/aB9XaU1qRqxHimEGXw9sqs5oeopED8jnp4vVP7gG9vfBh4cpr1Ce0z6U jeGkHZJTmC8ZF0MsM1h6s/e+BDNHugCFxQ6+NnzRWaI/VYT978PlHHF6QS86F3UgMaMq J1G/7ZRgwtOtw6mERyS+eHpXbeeNpweq0XRlbT7L2VfXy1jPwqN1ibuiSrRwTMgTdkRG HlMg== X-Gm-Message-State: ACrzQf230rozK0AGCW7y3Bs/+F8pj7uQSoj1vtdrN8bfRuNlszV5V0A7 PWHKu1xIfpleC8Cxv28sBcRlgUb6FVlBVQ== X-Received: by 2002:a05:6214:37c5:b0:4bb:bf0e:ca65 with SMTP id nj5-20020a05621437c500b004bbbf0eca65mr57881922qvb.17.1668041100536; Wed, 09 Nov 2022 16:45:00 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id x1-20020a05620a12a100b006eeb3165565sm11678506qki.80.2022.11.09.16.44.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 16:45:00 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v2 1/7] serial: liteuart: use KBUILD_MODNAME as driver name Date: Wed, 9 Nov 2022 19:44:44 -0500 Message-Id: <20221110004450.772768-2-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221110004450.772768-1-gsomlo@gmail.com> References: <20221110004450.772768-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749067951705170575?= X-GMAIL-MSGID: =?utf-8?q?1749067951705170575?= Replace hard-coded instances of "liteuart" with KBUILD_MODNAME. Signed-off-by: Gabriel Somlo --- drivers/tty/serial/liteuart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 4c0604325ee9..32b81bd03d0c 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -57,7 +57,7 @@ static struct console liteuart_console; static struct uart_driver liteuart_driver = { .owner = THIS_MODULE, - .driver_name = "liteuart", + .driver_name = KBUILD_MODNAME, .dev_name = "ttyLXU", .major = 0, .minor = 0, @@ -322,7 +322,7 @@ static struct platform_driver liteuart_platform_driver = { .probe = liteuart_probe, .remove = liteuart_remove, .driver = { - .name = "liteuart", + .name = KBUILD_MODNAME, .of_match_table = liteuart_of_match, }, }; @@ -368,7 +368,7 @@ static int liteuart_console_setup(struct console *co, char *options) } static struct console liteuart_console = { - .name = "liteuart", + .name = KBUILD_MODNAME, .write = liteuart_console_write, .device = uart_console_device, .setup = liteuart_console_setup, From patchwork Thu Nov 10 00:44:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 17875 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp646428wru; Wed, 9 Nov 2022 16:46:22 -0800 (PST) X-Google-Smtp-Source: AMsMyM4yZ7fRMeOz+dtp1KpZxJkEsc7ATg+ZJq6QlnQ2HxypeGBDB0oeGBL6k166HdIMJcmLGeHk X-Received: by 2002:a63:5341:0:b0:46f:d05d:55cf with SMTP id t1-20020a635341000000b0046fd05d55cfmr44624736pgl.356.1668041182511; Wed, 09 Nov 2022 16:46:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668041182; cv=none; d=google.com; s=arc-20160816; b=pDYFaIxWZ+ZsKJsnN2K7NiY6mc9K3ECE5P83Pv3jIwVXXrA+YzXbkKre+ngdLt6TxT H8pScAKtJfigpgaIcr04wjDCJevWW9kLjbrTerlXg4iUc90IYjBOn6dzox8W7yrH/5Lk Q2FBqB6GIRZ1XjwyiPFYiZF4EKaQ/Imuc8/vfsWxC2ozOqckSs6UjOg5iwqQZktueCnZ kNFHZ9OyEtdJK9FWqgOiKoMVfsqDnTVEfdXpPT7CF1ih7SxpcZyfvKD7IwFDCicoeiPK adzjupQElSOR5wSd6cTA+Ga+5fOv+xh6AnppzmvzOyJeVtw7fX9eZVqY04oY/Fs92Rva mcPQ== 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=h9s8/P3zcC35a/7U8wwUtQnHUttoN7Pw9xSfTjSoDyA=; b=AnMKSzAgVY7Mdv/rd4rMSoXhsnb4gMMcx0yNBy9YZFo918aiJgf5cUx0L4aQsJ3Wgz dfLujPqo9xPlWNo1KHcImqINnK/x+JkvzWN7KsnvO2+ej1qWSsvSMLtKpMHWJY6nMdKS 4KHEv1O9SfITY9kVhiSqZa/2KOG/6eWQYO0Y/u9UAkqnQlrzIEdzCM7NFt/lpYkhKFYH zDpsD/PBgJkz+hy0avst6M/AKQ9iWivQD7Z4svPUE2AHXC1OZBqfDQj19+iLuGWy+Yt9 hbbuz6mQWUmkIEn99rmfDCYhD686UKQLZC8fVpX76Os6U31Uo867Wwa0nT1rPqKUn3PY MwRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="hbOdGCr/"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a170902cecb00b00180a7ff784csi21431220plg.360.2022.11.09.16.46.09; Wed, 09 Nov 2022 16:46:22 -0800 (PST) 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=@gmail.com header.s=20210112 header.b="hbOdGCr/"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231933AbiKJApL (ORCPT + 99 others); Wed, 9 Nov 2022 19:45:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231624AbiKJApD (ORCPT ); Wed, 9 Nov 2022 19:45:03 -0500 Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A5E711A38; Wed, 9 Nov 2022 16:45:02 -0800 (PST) Received: by mail-qt1-x82a.google.com with SMTP id h21so209507qtu.2; Wed, 09 Nov 2022 16:45:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h9s8/P3zcC35a/7U8wwUtQnHUttoN7Pw9xSfTjSoDyA=; b=hbOdGCr/K0H7cTvzahxLz/afXIjxiMYM/7EfCCehv5O3BPGDT+Pfj+2RLo6LdQWP6f ORJWdJV6UoxqD/U6Sv/BEXCXhBj4XhOrksXCXxGDeiXmbXsN/lAAHM0d2MtSWhVZ/bxS DjYFG5sn/RVkWQ5QWsirOa2PN9Mtsx38qQtPTMaJ4IUd8fJwQeCH8RcpfgPz/Mr5g6Uu aaA8NEcrTsqlr6nKr8YTrH8HVnUMCvFZdbtZyqgm68NZ4c/qpli3NUl46PMM8L0a1sGe fteOcePpTbsx8DqZqReNv7I+HgIYG6Gz6u3yJ11UGnqTQ0v0gPehmfae251RQztU/Ko3 gokw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h9s8/P3zcC35a/7U8wwUtQnHUttoN7Pw9xSfTjSoDyA=; b=trFq+DxTV2m+Y+3QPaGDx0rHFzcotDkKwVIKZqmQM50SMgZd87SrWiioH+On07zqXp 6q4o6g91C8XPBnDnrm/YJAE4EhtBETtJpFLMAwwI24jSS3+/SEU//j2Zaran08DeIZ5e hZjsYCfgnZxNLtyGxFsYuFFPfaFyUsLXcxShhWJOs2L1WumGMChFoavsAAZcsqSvHSkG 8HkUXoTt+u9IgSTtwqUAQyaq0UQWWvUKw3x7S+aXeJTKrszbZ7GppA2QY0pUN8LqOoPg J0D532X5UwR6G68WyzsBWDBoYk/UhXvi4ux3UrahpDKrHBz+VHZwc1tmm9QRF4T6O0g3 5Rgg== X-Gm-Message-State: ACrzQf1w4Nw7npYd9NkH1ZSEwFgP0ZNpeAguYwu0tZ6m94jnV1ATrtPW j76ZCIAyEZDXXTcQmXnP5Gzai7Mf7LA6Ww== X-Received: by 2002:a05:622a:116:b0:3a5:7422:112 with SMTP id u22-20020a05622a011600b003a574220112mr21434198qtw.429.1668041101489; Wed, 09 Nov 2022 16:45:01 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id x1-20020a05620a12a100b006eeb3165565sm11678506qki.80.2022.11.09.16.45.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 16:45:01 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v2 2/7] serial: liteuart: use bit number macros Date: Wed, 9 Nov 2022 19:44:45 -0500 Message-Id: <20221110004450.772768-3-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221110004450.772768-1-gsomlo@gmail.com> References: <20221110004450.772768-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749067951129172598?= X-GMAIL-MSGID: =?utf-8?q?1749067951129172598?= Replace magic bit constants (e.g., 1, 2, 4) with BIT(x) expressions. Signed-off-by: Gabriel Somlo --- drivers/tty/serial/liteuart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 32b81bd03d0c..1497d4cdc221 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -38,8 +38,8 @@ #define OFF_EV_ENABLE 0x14 /* events */ -#define EV_TX 0x1 -#define EV_RX 0x2 +#define EV_TX BIT(0) +#define EV_RX BIT(1) struct liteuart_port { struct uart_port port; From patchwork Thu Nov 10 00:44:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 17877 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp646707wru; Wed, 9 Nov 2022 16:47:15 -0800 (PST) X-Google-Smtp-Source: AMsMyM612Z0q//9JpVim7LooK/vpNxcEeVx1+mnNPjPm6T5GAxk8YBovmRK79M/38p7y+iicv0aZ X-Received: by 2002:a17:90a:9902:b0:213:1122:feb9 with SMTP id b2-20020a17090a990200b002131122feb9mr63158692pjp.58.1668041235115; Wed, 09 Nov 2022 16:47:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668041235; cv=none; d=google.com; s=arc-20160816; b=p1jBFSRx4S/vByimPIY4b0sdpl3/cB1f6Etjz0ThbJsB1jPA4jMMsLMzljCLZuz4JB RmrlcFM22lFasDE5xKBRfr+eYJ7VHboVvXfHHz+9lUtcUkiZN9eQqcY9qAQrCazuROYL AGz5AnOGH7TbLdKktRho1qTmae8Owg1YD0Ok4Z/pBwuBTHA6ix+VeJyr6MqoTw/Si+fm CVAlFmxNw/WgqWZ+lA7XTvX/YEFm7P+WaRthK0EWAr5x6nNNIwCpgqoOLNbHJ8kOD9S2 hAyCCBwKuVfV1k4Qqj6/qpEUW+SNPbNbq30824QeyjhMRPGJzjSHpY2cMPfmSS9WNYZW sA5w== 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=8/8DPEq9jxGYQguFphHAE7bQWgOJIibend0gpSldrS0=; b=VqGSmfVfvOS8bt+TAkLqnbfSkFYSgkPECbd9mi4VL2GwamX28RDL2kPdpogEAlF+o0 eeCCsCXqkPuoMCmhQWAXOiMe/AobzY72SVVhBn+JZEtV1d70wb23M704rF5TvrYO3MGY jOCDTJ6hsnIGXiSIj+EoT/ecIp5tjFdTPoFmRsUL31P8qzAmaDrgQQYGH2uHgj15CNKS LnVfdr+RkGS4cjMn0nin5vkuyp8zaiipfAWLLchn2Qz8bI2eDj9sC0wZ0y3hNNmWSoL5 9o6DOI7nA0mfCHPiRKm2g0FdQn0WkMSwekSoP1NI1K5/iFebak0BmbHdIqqkHpuj74Kp j5Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mT17lCFF; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h10-20020a63df4a000000b004493c7cfb5csi19044015pgj.447.2022.11.09.16.47.01; Wed, 09 Nov 2022 16:47:15 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=mT17lCFF; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232085AbiKJApQ (ORCPT + 99 others); Wed, 9 Nov 2022 19:45:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231185AbiKJApG (ORCPT ); Wed, 9 Nov 2022 19:45:06 -0500 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FFE511C1F; Wed, 9 Nov 2022 16:45:03 -0800 (PST) Received: by mail-qv1-xf29.google.com with SMTP id h10so431175qvq.7; Wed, 09 Nov 2022 16:45:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8/8DPEq9jxGYQguFphHAE7bQWgOJIibend0gpSldrS0=; b=mT17lCFFkMNVGGG9W8O+qcZhEge+jj52nBLrIkSu/8YEl7pSo9u1dFJm2NY0KgoyF3 Xwx+GohbKhlZvD1DK4DmKicl/dfBTwm9mYwpViU1hGOUEqO733N3KELsx1VG67DK2oJ9 VoBbigjKfRKDH4ORW+s3msiecWxQASHB6CTLrEK5JoL7B8VTXsQfggP+JYmtUIJ2oTol ljhCRSRSycljXjrXyxO/SgTDCr8palizKAqiNw1hg2umh20j1pVRlmXIdAyClWOHvUZZ 73XfuioBqqaP/fI4sm3WnBkKZJn6uQVEUn0ucSSx/AH1Y3SkUx97UjX/bk2mFgOR03gA ZSlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8/8DPEq9jxGYQguFphHAE7bQWgOJIibend0gpSldrS0=; b=3Q25K3+gsVSceVlwtGtdjSvWSMer8Dv+WmURgOQXXLd4Gg5s7JyHovrGttNhMQilXE zDe+EoTBje9+YQfbeklRCP88QYTXyl7NKQ0DEGvx/n6N3BG+uHZz4sReGWPHH3kYYr5B Np2+mpea2084cyXEOm0IEF/dQGLh3VnYv0ctLpQO/zhGUiZWHDZeDQPaHlvzhjgwlEAT grwaUZtsix0u12XBZnyiADOMS6EAgp/VqbpBHlygRAx3vBgJ6iSIF3frWoW8lj++3W47 REOLdkOR9QDHjoLN+iTuOwAbt7llLgeW5YCzNUel5cOrhodSf6GZBEgwXhiVYhZsjKcA Sj4A== X-Gm-Message-State: ACrzQf2UbbUzazIWiB4ob/tGqP9geBXrjU+/P2PiQ5kVYqv/GRYyv4YU NXgf2QKztKIazTAa9vtVtL3sqVxIxX7Phg== X-Received: by 2002:ad4:5f4c:0:b0:4b8:ec94:68e with SMTP id p12-20020ad45f4c000000b004b8ec94068emr56638770qvg.38.1668041102417; Wed, 09 Nov 2022 16:45:02 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id x1-20020a05620a12a100b006eeb3165565sm11678506qki.80.2022.11.09.16.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 16:45:02 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v2 3/7] serial: liteuart: remove unused uart_ops stubs Date: Wed, 9 Nov 2022 19:44:46 -0500 Message-Id: <20221110004450.772768-4-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221110004450.772768-1-gsomlo@gmail.com> References: <20221110004450.772768-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749068006405059303?= X-GMAIL-MSGID: =?utf-8?q?1749068006405059303?= Remove stub uart_ops methods that are not called unconditionally from serial_core. Document stubs that are expected to be present. Signed-off-by: Gabriel Somlo --- drivers/tty/serial/liteuart.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 1497d4cdc221..90f6280c5452 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -122,6 +122,7 @@ static unsigned int liteuart_get_mctrl(struct uart_port *port) static void liteuart_stop_tx(struct uart_port *port) { + /* not used in LiteUART, but called unconditionally from serial_core */ } static void liteuart_start_tx(struct uart_port *port) @@ -154,11 +155,6 @@ static void liteuart_stop_rx(struct uart_port *port) del_timer(&uart->timer); } -static void liteuart_break_ctl(struct uart_port *port, int break_state) -{ - /* LiteUART doesn't support sending break signal */ -} - static int liteuart_startup(struct uart_port *port) { struct liteuart_port *uart = to_liteuart_port(port); @@ -197,15 +193,6 @@ static const char *liteuart_type(struct uart_port *port) return "liteuart"; } -static void liteuart_release_port(struct uart_port *port) -{ -} - -static int liteuart_request_port(struct uart_port *port) -{ - return 0; -} - static void liteuart_config_port(struct uart_port *port, int flags) { /* @@ -232,13 +219,10 @@ static const struct uart_ops liteuart_ops = { .stop_tx = liteuart_stop_tx, .start_tx = liteuart_start_tx, .stop_rx = liteuart_stop_rx, - .break_ctl = liteuart_break_ctl, .startup = liteuart_startup, .shutdown = liteuart_shutdown, .set_termios = liteuart_set_termios, .type = liteuart_type, - .release_port = liteuart_release_port, - .request_port = liteuart_request_port, .config_port = liteuart_config_port, .verify_port = liteuart_verify_port, }; From patchwork Thu Nov 10 00:44:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 17878 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp646753wru; Wed, 9 Nov 2022 16:47:22 -0800 (PST) X-Google-Smtp-Source: AMsMyM7QUvgn2O1EBjeCoJF5260o39hNt/BG3qBI633iBytSIy9NqpjeT/UrUkwggjQq4jZ47zG0 X-Received: by 2002:aa7:8d08:0:b0:56b:a4f6:e030 with SMTP id j8-20020aa78d08000000b0056ba4f6e030mr1472913pfe.85.1668041242490; Wed, 09 Nov 2022 16:47:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668041242; cv=none; d=google.com; s=arc-20160816; b=0I6IDDvE1ryVfE/DCjXcG8tE8wuT5znljZzw6PBJg2USkMSvWgQpzWOkyWjEsqnJ/C z/Bw5E9gw8dfI8SPxtZbPYsEjYBbyQMuE61t002erT5be5kp5xtUXj9ErFSatuejzn4T OhbwfV1mFL+0nWnwLDY6sdN/qWqXPc4DPAN1/Z1BKI18g3rHqSmZKf6/DbgpQgxizVAy nu6vujGGBGdzAU8KPh/8bkrXk65TrCE7LxgZTQuTyGifVckuQ+2UJpso6WqjwwTW2xnC kSJ62yFp2/mD78JFAAK3z/9g0mJY+CXYpOZcy2QBsKz3xEPpMdzB4y3Gars4Vqirv2SP w6Rg== 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=8WawqzZk7R2Fk2wsVcJJHQ6DiWGY8oW1x9eP6skVjzc=; b=JyMW6sDpo7f1aWrU/Zz+naoapmg23nrE50GUGMm3IgD6KvwI2w+0Ru53CITqo3a5gI 28ui22JsTzZYMUrNeg1DCxbjir3Co93XJCI5vbQnEP/lFJslAk58LtlG6CYNiMRqjIq1 x10t4CaAdTesPZeUR/EAlcKSIqz3j3nwEXiVy8rtv6BcF9YOz6fVsky7b+pNd9B2ykle yna76Hy+bRDT5q5uuLlqtgXz9lanC0z7xc8W7FB/XdxWvte1yyU3PRkLpaos2pOOTCx/ Cw2kylcgBezEgCntzMJBzblZL4S+7MwdeS5nwoA7Slxs1mFRTeTZIMDTd/68oAx4MpGE /vuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BouGuuFJ; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y21-20020a631815000000b0042bc6e8d3f7si18678288pgl.642.2022.11.09.16.47.09; Wed, 09 Nov 2022 16:47:22 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=BouGuuFJ; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232118AbiKJApU (ORCPT + 99 others); Wed, 9 Nov 2022 19:45:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230504AbiKJApG (ORCPT ); Wed, 9 Nov 2022 19:45:06 -0500 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AD0310B68; Wed, 9 Nov 2022 16:45:04 -0800 (PST) Received: by mail-qk1-x730.google.com with SMTP id g10so295278qkl.6; Wed, 09 Nov 2022 16:45:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8WawqzZk7R2Fk2wsVcJJHQ6DiWGY8oW1x9eP6skVjzc=; b=BouGuuFJgYKQlwMFnLgGAomksp6JBXvMmPKLTxSZ4G+wA3ulfHAPluhAeShcJ1lOp3 Sr2sZnNvNVX6XYeSEzxSpYNap/O2tMf/fJRnhmKTI0OWk1M+jvCYdbxEIwTCG7Jhlwdc vXFE/Z+vKHdgInLez+Io5DllqAz0hwdb799amr/myCmGoKsFJW00gNClTvumZrI+lh5k WvKMoLXpGBHR83oIF4lXM3W2xAAOAR7Mj/GLWKNUxT/2XcoXqKyaxHWyYpEIkwQ2aJVN 7UN1dwNzmIyQpCqBy9x6KTzU+OQOwD94cGF81nhjI8adYczgVTYWshljVGCsEJF79ZJO 9FQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8WawqzZk7R2Fk2wsVcJJHQ6DiWGY8oW1x9eP6skVjzc=; b=bQdzd7XbDzlCatWIT/BPjspo7DTUs2Or7EciUAlXdNP6tNwH7B14mx7utbr56OCpHF FvnWFEc3K2Y2xWVe2ed5Cd8TJRnUGC9Eo+cTRH6vvSd7Pws82pgTBLKPbxeyHEAu+ajS uceMXl+ZNz9sxrK7o9xnb4kZ9/p8bNJ+5TmbH9YwM4wnj1uN8Y9JoIlK0DqkRmMLt5lp RTlWqeySF5wlUgJyk2lPwsqa+HX2CDWsnbg+eRGfll3/NM3ABJA7fNZwN85Tzb7Xppw9 jmLZ4KEgrhI7VQbmzaEjsS5cWHpcNkSxyiWlGby3xcJ5asWSx1EITLn5Pa9OIwsu1OOc HZXQ== X-Gm-Message-State: ACrzQf00zlz94FaPQTjooie8VfnmcpWrIUwcPow/wvd3JiBTEbT38VFO Vjs0eDBpsAHYYBzlZ2sQE50sUghE/7OzpA== X-Received: by 2002:a05:620a:13db:b0:6fa:28c5:e06 with SMTP id g27-20020a05620a13db00b006fa28c50e06mr41372617qkl.629.1668041103435; Wed, 09 Nov 2022 16:45:03 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id x1-20020a05620a12a100b006eeb3165565sm11678506qki.80.2022.11.09.16.45.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 16:45:02 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v2 4/7] serial: liteuart: don't set unused port fields Date: Wed, 9 Nov 2022 19:44:47 -0500 Message-Id: <20221110004450.772768-5-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221110004450.772768-1-gsomlo@gmail.com> References: <20221110004450.772768-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749068013725349764?= X-GMAIL-MSGID: =?utf-8?q?1749068013725349764?= Remove regshift and iobase port fields, since they are unused by the driver. Signed-off-by: Gabriel Somlo --- drivers/tty/serial/liteuart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 90f6280c5452..5b684fd198b7 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -264,9 +264,7 @@ static int liteuart_probe(struct platform_device *pdev) port->iotype = UPIO_MEM; port->flags = UPF_BOOT_AUTOCONF; port->ops = &liteuart_ops; - port->regshift = 2; port->fifosize = 16; - port->iobase = 1; port->type = PORT_UNKNOWN; port->line = dev_id; spin_lock_init(&port->lock); From patchwork Thu Nov 10 00:44:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 17880 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp646817wru; Wed, 9 Nov 2022 16:47:35 -0800 (PST) X-Google-Smtp-Source: AMsMyM6edN6HhlO+d1drhOXs/Rjf8tmXflzddazNO+uMR+ZDuHxMbirqGl2Ag2gDZcvWio1X/tPO X-Received: by 2002:a63:5d09:0:b0:460:9fe9:d325 with SMTP id r9-20020a635d09000000b004609fe9d325mr1395348pgb.608.1668041255272; Wed, 09 Nov 2022 16:47:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668041255; cv=none; d=google.com; s=arc-20160816; b=U6WYHjjvv4SnXq5vQ800OMmOuzbOCh1rnJDKRuli/dqJdPJSisTLTr3a8lFfGFQC7L T710JrGjyeTdie8f4l204Mc/FH80T3O+H4rOyXAQSEE+kdhXY+1leyG2QzgV7c94iN1N 2dl5wsWpAAXx8dGWNebt4t3Pzui5ltNPZBqBQKSezWCrvWW8rwsCh5nefU82MtwOWPty qOcjICS2agoL8ZaUReLKVjwfRQSpqk7925tF5tWNjmbyiFEUGD2cBaKvLoUx1XFAWrmR Q7UKaNBNfUR/d41zPy4ld1pOJcFUOWVX34D0HGZSAu0Z96K1RxqjTDfdX+oWHfm6qGtk j5dQ== 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=MThhfi/+6K/LOJrqVDZeVBTVPExj3Q+f1CKmXTQaNyE=; b=Ck19OgZRnMI1i+Y6uj/OKOM2H2RuwvFvucHxmXa1uuCjCrUSPAva1HDpngJ3LxZgew N8d4SEJ9b+ypeZanwMyQ/dDB9akic+fSYrhg0Bavh9Bq8HIdqbgUEDZy8pHSbzweiq9I QV4hdYbrbt24e6rPUc5gn40SgppOqLuZjaEtXbvdYb9CGMnGcEGEgzWsye4G9ZsNTJV0 J6RRNM3Z5X67KxbylKIqgSZW5qhMxn8sRs0Ok7bpDMsPLh72K67fdA2Svteax+zfaznH 3RlGTeF0FFTXHkn3AxykE6u1Yf5pMj7AAVTn85R5RoJCi2fSn7RBpr8rQEMn2228ZtR3 WULA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DAHYdZZo; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v25-20020a637a19000000b0046265702353si20206699pgc.203.2022.11.09.16.47.22; Wed, 09 Nov 2022 16:47:35 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=DAHYdZZo; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231956AbiKJAp1 (ORCPT + 99 others); Wed, 9 Nov 2022 19:45:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231842AbiKJApH (ORCPT ); Wed, 9 Nov 2022 19:45:07 -0500 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 723801181C; Wed, 9 Nov 2022 16:45:05 -0800 (PST) Received: by mail-qk1-x72f.google.com with SMTP id x21so331809qkj.0; Wed, 09 Nov 2022 16:45:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MThhfi/+6K/LOJrqVDZeVBTVPExj3Q+f1CKmXTQaNyE=; b=DAHYdZZoIL7Pd0YKF9Mnb6+h8QIEevMKOBWXVhUndf3BAOgh7GrkrZJXPF/LEwPMcP mGFa+NGQxKvkOAAAOTjMOHmw7ig4oIYxZN50g7+QOu+TKxKUIIc57dkGBFeDPNq60OdI DaDkfeqnd/SeCg/A+WKzV66OyqLak6PuqlZDCJGcOkggQKYd4TQOEffxPpGpgtpFxfv9 JgnFJqd1LKgOyKA8aSARWdblYHvoRAbQ7sTepOg4zlaozzTcLP8mMapnhYGZEpWo9D6V jadPyjx1WJ/5HvNA8Z5h7AA48phggj/nBE7w5GfkW/KGgJrvRvARvMVzLEKBa9Uf1/p5 VQdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MThhfi/+6K/LOJrqVDZeVBTVPExj3Q+f1CKmXTQaNyE=; b=0tdvO2zzPAAFhz8M1mwjR6Za7xO67qxGAGdG/zn5IchrcFNiBx993N8FgjGF/OvYC3 xI8i3aUm9o2oweitBTmaHoJXzLSmU6bHVqSDiVMjZmbb9VrvQFeuaNb/CWD0149GQ41o 47e83kSQSPFkJS6uQ4B8n9x+kkIQSMwfkPc7YHP2jZdp02lnsJ/uHYBhZZiLLv8gf9Js Tl0gmTFgcwj98DV8L1VHONfsfi4VoCR0pP2sGrbunzHojgmqZrgtUjwfgG8I0znbxb3h cW/w0ElR+yY0TCKB3Y9r67d0X5zC/jRFvoim6FvJFVHGw9vrbfnC5WYYzxRllGqCvYYp gSTA== X-Gm-Message-State: ACrzQf2D2bISuJtGmvP343S1ZVoa969a6h46vfgAC4LjSk6qYNRQiMJ8 32EF+JAJAZpjB9FD9ioU1qxwgKM31v8xjA== X-Received: by 2002:a37:b6c4:0:b0:6fa:7c9f:edda with SMTP id g187-20020a37b6c4000000b006fa7c9feddamr24899601qkf.13.1668041104322; Wed, 09 Nov 2022 16:45:04 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id x1-20020a05620a12a100b006eeb3165565sm11678506qki.80.2022.11.09.16.45.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 16:45:03 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v2 5/7] serial: liteuart: minor style fix in liteuart_init() Date: Wed, 9 Nov 2022 19:44:48 -0500 Message-Id: <20221110004450.772768-6-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221110004450.772768-1-gsomlo@gmail.com> References: <20221110004450.772768-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749068027152837507?= X-GMAIL-MSGID: =?utf-8?q?1749068027152837507?= Signed-off-by: Gabriel Somlo --- drivers/tty/serial/liteuart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 5b684fd198b7..047d5ad32e13 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -398,12 +398,10 @@ static int __init liteuart_init(void) return res; res = platform_driver_register(&liteuart_platform_driver); - if (res) { + if (res) uart_unregister_driver(&liteuart_driver); - return res; - } - return 0; + return res; } static void __exit liteuart_exit(void) From patchwork Thu Nov 10 00:44:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 17879 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp646764wru; Wed, 9 Nov 2022 16:47:25 -0800 (PST) X-Google-Smtp-Source: AMsMyM7ZWWC4rqfJ87M9t4a1qqW4lUOLdwpOFmu8Da5H7aSMYpIIVzNfVpbAHDF2ZWqbu73194jP X-Received: by 2002:a17:902:ed53:b0:186:6ad3:c155 with SMTP id y19-20020a170902ed5300b001866ad3c155mr61712017plb.43.1668041245169; Wed, 09 Nov 2022 16:47:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668041245; cv=none; d=google.com; s=arc-20160816; b=WLdW5TTtAfcrWE1I62EbU0iYItCArI4COFQro0o2+jYFZX3A5S2+tpzb4zBaSr9VZS vnvB2C7btyiJvzQ8qUsOzbmRqHnQz/BoCg1lLTUkOnpoqHNrjAtSQ4QclFZOWdzz8eHZ 9qmjiFyi9eNG0B8itEHrUR7fFQQD8aEvXZBJTnVXJveFghR8oc0o03EbTPwEY65ICUL3 PSKBSx55d6aNR4NuWq+N5ssvcaplNb3UtC+fcqR99dW9bXhVd0vnNUDdG5KtVhgpzUK6 7A1for//mZVGDYFFoZIGtrg1rpLovMrAjutZz0gmen06/77mlwQlKrve7M4A77F2goy4 kJUw== 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=JGJtELmNn2N31csZAgx2uQhrYPHpFF+hYpnYsk0wKOQ=; b=dzJiDQu2p0jTABeEiGk1Km0OuST27qHea20aRfzYHtVXKka0U6dM94FLRY5ZlGYNAA JaoM4N66wJNut9xgwUYW8ugXk9trvb/t3KRieNNd0FpaHufaB5vPaSxHgF1esdGWyoON NXKzOaYRCppRb5GJYSLvptLdJBkX1dORDL9FzziTm0+SUUsGwHjPmLDMevfZjtAfAckn saqdefPmZPj+XB49hb3a5PDE7oPRmzW/y4k/2LWKXJ2q2GNdfComyKPKUpmHpGKTpwmx 4g35Oo/Yic3WKO5eIwvvyQgptbr+fFbqhBDMB2K4pFPp2nClPku2YLHbQGnIZ/tcfIVJ 55Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PGzXe0NF; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020a170903108500b00186f4d6668csi16048462pld.261.2022.11.09.16.47.12; Wed, 09 Nov 2022 16:47:25 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=PGzXe0NF; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231298AbiKJApY (ORCPT + 99 others); Wed, 9 Nov 2022 19:45:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231898AbiKJApH (ORCPT ); Wed, 9 Nov 2022 19:45:07 -0500 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB23610B4B; Wed, 9 Nov 2022 16:45:05 -0800 (PST) Received: by mail-qk1-x72b.google.com with SMTP id v8so276361qkg.12; Wed, 09 Nov 2022 16:45:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JGJtELmNn2N31csZAgx2uQhrYPHpFF+hYpnYsk0wKOQ=; b=PGzXe0NF6uhRCr/YlqlmwGO9Vn7L9XDFgrwLwqdU3s+9e4Guk+msChFd1ZpbLpuR/j krg277Y74VLK04l9Kn9/mpojXgvJfkw7SlwoxpvBzFrCPbfwmwSrHGkY6EWSIqocbZnK 7qC6MdJIoAS6tf4nib2gB70ymqOlYvVj0GgwYxN37N/dqIC9T/emrkQ8tGx/BEhzqI3/ TvnBgNQgffvQVNSkMBqJaaVwsdoE5tHlXdW1UTi+DakZPAybRW+AAGAh5eKSGgwIY6Xc +RCYUf0P8et2C915xHdKldzeUBB1rM1HkFGtSikA6xzOi9bxAAtx/JVLKXVzXfVSodTG /9kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JGJtELmNn2N31csZAgx2uQhrYPHpFF+hYpnYsk0wKOQ=; b=yqjWb7p3uSZpltnJwZd9CC9Rq1hn+l97XqJq2yJqw3SF6AvCXeOFOK8CEZGkMEVELS MEl+7TJpNYEV7BNnWuTMK/dGZyvOCj8KDtUINL3EFJ3r59fPZpeLoF2DZyN4c0K0rdM3 z15YKvamjpNIvZXuuFNCnbb9gY4Qm7JdPpwqzb66Eom9eYzwGNtPV3Fdn9wcWEpn/QAE sGvldyb7jn5Ft+R5EHmWysoz+2l3JNKbnzDf4gIt7uVF9hm6CZNHa9nWg+4Y3NVaDa4u NmWdXU465XUTNwFb7jiCWdrM3dIzUEyu/yVYqKkVZLoLoc1PnPkTBvBSPqsjzFIsdvgo I28A== X-Gm-Message-State: ANoB5pkeDSlCt5+7s78z7DWviBVTqJk6K0gmN8lC7IhJl0eu3g+phSPu 2KG/p+QiBnPkTU+NBkfi2VmG84eY/rEEkw== X-Received: by 2002:ae9:f30d:0:b0:6fb:7cb:7b21 with SMTP id p13-20020ae9f30d000000b006fb07cb7b21mr7851196qkg.653.1668041105219; Wed, 09 Nov 2022 16:45:05 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id x1-20020a05620a12a100b006eeb3165565sm11678506qki.80.2022.11.09.16.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 16:45:04 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v2 6/7] serial: liteuart: separate RX loop from poll timer Date: Wed, 9 Nov 2022 19:44:49 -0500 Message-Id: <20221110004450.772768-7-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221110004450.772768-1-gsomlo@gmail.com> References: <20221110004450.772768-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749068016281063545?= X-GMAIL-MSGID: =?utf-8?q?1749068016281063545?= Move the character-receive (RX) loop to its own dedicated function, and (for now) call that from the poll timer, liteuart_timer(). This is in preparation for adding IRQ support to the receive path. Signed-off-by: Gabriel Somlo --- drivers/tty/serial/liteuart.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 047d5ad32e13..aa7052280197 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -67,29 +67,34 @@ static struct uart_driver liteuart_driver = { #endif }; -static void liteuart_timer(struct timer_list *t) +static void liteuart_rx_chars(struct uart_port *port) { - struct liteuart_port *uart = from_timer(uart, t, timer); - struct uart_port *port = &uart->port; unsigned char __iomem *membase = port->membase; - unsigned int flg = TTY_NORMAL; - int ch; - unsigned long status; + unsigned int status; + unsigned char ch; while ((status = !litex_read8(membase + OFF_RXEMPTY)) == 1) { ch = litex_read8(membase + OFF_RXTX); port->icount.rx++; /* necessary for RXEMPTY to refresh its value */ - litex_write8(membase + OFF_EV_PENDING, EV_TX | EV_RX); + litex_write8(membase + OFF_EV_PENDING, EV_RX); /* no overflow bits in status */ if (!(uart_handle_sysrq_char(port, ch))) - uart_insert_char(port, status, 0, ch, flg); - - tty_flip_buffer_push(&port->state->port); + uart_insert_char(port, status, 0, ch, TTY_NORMAL); } + tty_flip_buffer_push(&port->state->port); +} + +static void liteuart_timer(struct timer_list *t) +{ + struct liteuart_port *uart = from_timer(uart, t, timer); + struct uart_port *port = &uart->port; + + liteuart_rx_chars(port); + mod_timer(&uart->timer, jiffies + uart_poll_timeout(port)); } From patchwork Thu Nov 10 00:44:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 17881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp646836wru; Wed, 9 Nov 2022 16:47:39 -0800 (PST) X-Google-Smtp-Source: AMsMyM7hDP2SUlGfEDo7tx+YnFzMOtjYrKeCwrKX0g8fNDforhq/V2cTycWYgo6y/kiHCZ0B6gA4 X-Received: by 2002:a17:902:f651:b0:184:6925:d127 with SMTP id m17-20020a170902f65100b001846925d127mr62160988plg.140.1668041259678; Wed, 09 Nov 2022 16:47:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668041259; cv=none; d=google.com; s=arc-20160816; b=SJY7I/Aheo1cxXCilotb1mrmE12+LaDwhfKusBeuASvqtEFBtvoNVwXsFhSK2nW+y/ RSHY32snbrO4siX/9Ob7kWtL5ps2htOAHkWScm/fWMunftJWYBI+cYnF86Je2M/u6V0h BfGLY3WsqOOC85uEyjF5zaEpxf5hKXSTIJGvnBFuumYxNyp5poa42GyfIuWeIsPGk3Bw +r6pfvLkkWljkZoKxfJ0cIJ7wDNgk832MgXOxy0tUwvNYbQP4pDLevk2eSobR7utxahU pGzItwVTzFnX4p/CRsxFQezl62RvoVTC4aH03LG5U5BEbvSWql3Z1BINPmgHXqmX7ZwB vB3g== 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=+gDpqiQ2v07jcXDv+V+5mliWVvvI7QzpDNtOf1ZH6V8=; b=ABTIVuIdymiL3jK1sf96Iczy9Ojs8KmGLNEUWBJcxncTCEV5SVDc4VGfDec3Q4lv3c e+XzeDhTyiUx8MUCXvJYGc/JvJ5UEiCFYekn1Z5b7+LDinf1H+4T6eHn8QbO/p44y7Aj ucC4rPNTeE1sEL0fY04MFbu6JACo+U3JzzpHw/OSY2x6biabAyWzoFZKajqy2FlcViwN Y3MFQHLBUJUi49yFrfmwkMYalnhIsbNzzsahduT8Tv5tUKIYias/peZv4wgrjwCQpuxz 3BcvpbGmyz+0JLWZP6dtCHTKAekVUsFre0z/28MnecYoxsVjIGFazoErl5HLG2ux9SZ2 qzQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UKJoFM9G; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x12-20020a1709028ecc00b00181dc40f516si17624746plo.146.2022.11.09.16.47.26; Wed, 09 Nov 2022 16:47:39 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=UKJoFM9G; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232123AbiKJApc (ORCPT + 99 others); Wed, 9 Nov 2022 19:45:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231949AbiKJApI (ORCPT ); Wed, 9 Nov 2022 19:45:08 -0500 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B5D411C1F; Wed, 9 Nov 2022 16:45:07 -0800 (PST) Received: by mail-qk1-x72b.google.com with SMTP id s20so299148qkg.5; Wed, 09 Nov 2022 16:45:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+gDpqiQ2v07jcXDv+V+5mliWVvvI7QzpDNtOf1ZH6V8=; b=UKJoFM9Gfo4iktkKb4AhB4lJnkAdV940srYt0j+gLCpBXNv0FaYU6SpVIh6JdC1fDR iHXJjhNo5C9pFNNm0IiGbEuqUcb8MneWBurYovZKXBQM8pqJvZ2agsAACBaKOXqg/+Bw FPYJ+GCUIIajWyAnJcHaZI+QWZubGkUq5cYZTza5PzYbyDlVeDtXboHKO/kuVlKBqKsm oBlITBLnxIMXFbdAP4In+DKLcC8x+/WSHZE8VMfYpZNYYKYpcCJ16Zc+YmX+UVjlrPUX eziVvkE2aZjGRkzsFoL0H49py5ZKg0uqDBTbpE6CY5v6exd1AfcZ0eYkpTCNoS+W34Mw pnbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+gDpqiQ2v07jcXDv+V+5mliWVvvI7QzpDNtOf1ZH6V8=; b=TKq7Ilmp46KbC75OvC0Ol3otxxpK+7umaU6Ko+TOH9p+vatKgqAkNq5j2rwX+QJmFV Vg/g+IO7FH4d09iPuIoJlduBvvZUF0tAjr78rTlejLp5llpXfrak0KqL0lEx3pf5bJnN pd3+fCy1bE25grEFAn7Qp67jrmIAaMhgsh8ijkIO3Paft7SHEfuh5A9F6XXaun7dUCSs /TjxSoIPZFUytvirVoNli+uLJYuM1l1E30k0rSOE9mGjxM8720aRXOkSI4xTIxsyc7AG znsEwr9XwqjEG5hIBOrxrfr+cmWcng73i1q20Khje22Noa70D2z8uR/+mlZf5aJURq0j HqcA== X-Gm-Message-State: ACrzQf02fQ6ei2c/D2mxnn+XjvRw2IVeENlm0xsQsl3JRQ9ePzWFpH/V K3axYQRfPyuhGLLlL7c3riXhCQ84xtbFXg== X-Received: by 2002:a37:ac0f:0:b0:6fa:1185:4e7e with SMTP id e15-20020a37ac0f000000b006fa11854e7emr46101376qkm.334.1668041106140; Wed, 09 Nov 2022 16:45:06 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id x1-20020a05620a12a100b006eeb3165565sm11678506qki.80.2022.11.09.16.45.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 16:45:05 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v2 7/7] serial: liteuart: add IRQ support Date: Wed, 9 Nov 2022 19:44:50 -0500 Message-Id: <20221110004450.772768-8-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221110004450.772768-1-gsomlo@gmail.com> References: <20221110004450.772768-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749067929372420227?= X-GMAIL-MSGID: =?utf-8?q?1749068031799848548?= Add support for IRQ-driven RX. The TX path remains "polling" based, which is fine since TX is synchronous. Signed-off-by: Gabriel Somlo --- drivers/tty/serial/liteuart.c | 66 +++++++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index aa7052280197..45da944d1fea 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -88,13 +89,27 @@ static void liteuart_rx_chars(struct uart_port *port) tty_flip_buffer_push(&port->state->port); } +static irqreturn_t liteuart_interrupt(int irq, void *data) +{ + struct uart_port *port = data; + unsigned int isr; + + isr = litex_read32(port->membase + OFF_EV_PENDING); + + spin_lock(&port->lock); + if (isr & EV_RX) + liteuart_rx_chars(port); + spin_unlock(&port->lock); + + return IRQ_RETVAL(isr); +} + static void liteuart_timer(struct timer_list *t) { struct liteuart_port *uart = from_timer(uart, t, timer); struct uart_port *port = &uart->port; - liteuart_rx_chars(port); - + liteuart_interrupt(0, port); mod_timer(&uart->timer, jiffies + uart_poll_timeout(port)); } @@ -163,19 +178,49 @@ static void liteuart_stop_rx(struct uart_port *port) static int liteuart_startup(struct uart_port *port) { struct liteuart_port *uart = to_liteuart_port(port); + unsigned long flags; + int ret; + u8 irq_mask = 0; - /* disable events */ - litex_write8(port->membase + OFF_EV_ENABLE, 0); + if (port->irq) { + ret = request_irq(port->irq, liteuart_interrupt, 0, + KBUILD_MODNAME, port); + if (ret == 0) { + /* we only need interrupts on the rx path! */ + irq_mask = EV_RX; + } else { + pr_err(KBUILD_MODNAME ": can't attach LiteUART %d " + "irq %d; switching to polling\n", + port->line, port->irq); + port->irq = 0; + } + } - /* prepare timer for polling */ - timer_setup(&uart->timer, liteuart_timer, 0); - mod_timer(&uart->timer, jiffies + uart_poll_timeout(port)); + if (!port->irq) { + timer_setup(&uart->timer, liteuart_timer, 0); + mod_timer(&uart->timer, jiffies + uart_poll_timeout(port)); + } + + spin_lock_irqsave(&port->lock, flags); + litex_write8(port->membase + OFF_EV_ENABLE, irq_mask); + spin_unlock_irqrestore(&port->lock, flags); return 0; } static void liteuart_shutdown(struct uart_port *port) { + struct liteuart_port *uart = to_liteuart_port(port); + unsigned long flags; + + spin_lock_irqsave(&port->lock, flags); + litex_write8(port->membase + OFF_EV_ENABLE, 0); + spin_unlock_irqrestore(&port->lock, flags); + + if (port->irq) + free_irq(port->irq, port); + else + del_timer_sync(&uart->timer); } static void liteuart_set_termios(struct uart_port *port, struct ktermios *new, @@ -264,6 +309,13 @@ static int liteuart_probe(struct platform_device *pdev) goto err_erase_id; } + /* get irq */ + ret = platform_get_irq_optional(pdev, 0); + if (ret < 0 && ret != -ENXIO) + return ret; + if (ret > 0) + port->irq = ret; + /* values not from device tree */ port->dev = &pdev->dev; port->iotype = UPIO_MEM;