From patchwork Mon Aug 17 08:59:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 258134 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C167C433E1 for ; Mon, 17 Aug 2020 08:59:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5468420758 for ; Mon, 17 Aug 2020 08:59:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PiVBIWKY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728718AbgHQI7k (ORCPT ); Mon, 17 Aug 2020 04:59:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728307AbgHQI7j (ORCPT ); Mon, 17 Aug 2020 04:59:39 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E26E7C061388; Mon, 17 Aug 2020 01:59:38 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id l60so7491463pjb.3; Mon, 17 Aug 2020 01:59:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dprMDdtzRUqVhrLyliJzSuOBrFlLqstZsl9JNe0NSK4=; b=PiVBIWKYpZOwpl3l30M6Fo3rPU5nW0nfTubZQV7JUc+vV0A64yGrNLFdEjouXpaa5k Z5MoM3QXi9zN03azfYuFoEgScl5BTcR6CYvCRXQ0yUUkhjRyt2gbWOpjMrL8eEKGIAH/ t5PN9g3nz5jnInLj5+xhlgTaoAPzC1QEmRa/NN3HL8FR4C0cKFBl2OyupfYgLxWhk4qZ y6oV4Jn7ofsbDRM2qFptLzVp5oA/WPWcct7BDmWBh2FIlElullflHeaz9Rjp6X4myAn5 MJD3otw4Ijv/FhpK+p9x8q2mI9Vd1VRlhBf7SnAUps5VsK+hCda8WhTlrQ/B6j9SiBas 2ZAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dprMDdtzRUqVhrLyliJzSuOBrFlLqstZsl9JNe0NSK4=; b=HHpWEkVN7NBP/RiyeNvU+R5//i8XBHa4iXd8T/d6fZtucwhmwHK67YcTBAWl1pSfrt 93yDMSOasSuXmH3l7wKDr2VS4mON0yQJXcwyH2tXuHx/2tAU317lWWJhy18MIZ6nqAhD zELc/gLiWCzJ6HJ5KCEs0ants3pH9ZR4MqZgYpN1cdd3Rh/tmy1+ArAWTHD7hBYyrz/z O1INngrRRxqbYri5y9tnrLWojpyxvbt/8lI+emUHp8ouMuCF7TUR5ZlcqOqoMJidosVL FlWlc8pjCVkYEzTaOsly7va3p7Y9YHtrBTZcZxOWRwWtdqrnIUPWPBfgpL/IzAz36sUy PG3g== X-Gm-Message-State: AOAM532lnc/e0OsLB0VXdep8vRhA7KkFCE688oCSYsE/d3+XyqHaXrd2 J8KkBV3eYwDZx54qPy+NzJbdHtuGc6/jmA== X-Google-Smtp-Source: ABdhPJyhdp9fjnJK79p+NpoPwon5bOwfZA4oyGKma49ni2x2sF9tVyQew0t66rGvuOPdfS5alrGOlg== X-Received: by 2002:a17:902:c154:: with SMTP id 20mr10665077plj.64.1597654778442; Mon, 17 Aug 2020 01:59:38 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id j13sm18508547pfn.166.2020.08.17.01.59.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:59:37 -0700 (PDT) From: Allen Pais To: richard.genoud@gmail.com, gregkh@linuxfoundation.org Cc: keescook@chromium.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Allen Pais , Romain Perier Subject: [PATCH 2/4] tty: atmel_serial: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:29:19 +0530 Message-Id: <20200817085921.26033-3-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817085921.26033-1-allen.cryptic@gmail.com> References: <20200817085921.26033-1-allen.cryptic@gmail.com> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/tty/serial/atmel_serial.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index e43471b33710..a9c47f56e994 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -1722,10 +1722,11 @@ static int atmel_prepare_rx_pdc(struct uart_port *port) /* * tasklet handling tty stuff outside the interrupt handler. */ -static void atmel_tasklet_rx_func(unsigned long data) +static void atmel_tasklet_rx_func(struct tasklet_struct *t) { - struct uart_port *port = (struct uart_port *)data; - struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); + struct atmel_uart_port *atmel_port = from_tasklet(atmel_port, t, + tasklet_rx); + struct uart_port *port = &atmel_port->uart; /* The interrupt handler does not take the lock */ spin_lock(&port->lock); @@ -1733,10 +1734,11 @@ static void atmel_tasklet_rx_func(unsigned long data) spin_unlock(&port->lock); } -static void atmel_tasklet_tx_func(unsigned long data) +static void atmel_tasklet_tx_func(struct tasklet_struct *t) { - struct uart_port *port = (struct uart_port *)data; - struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); + struct atmel_uart_port *atmel_port = from_tasklet(atmel_port, t, + tasklet_tx); + struct uart_port *port = &atmel_port->uart; /* The interrupt handler does not take the lock */ spin_lock(&port->lock); @@ -1911,10 +1913,8 @@ static int atmel_startup(struct uart_port *port) } atomic_set(&atmel_port->tasklet_shutdown, 0); - tasklet_init(&atmel_port->tasklet_rx, atmel_tasklet_rx_func, - (unsigned long)port); - tasklet_init(&atmel_port->tasklet_tx, atmel_tasklet_tx_func, - (unsigned long)port); + tasklet_setup(&atmel_port->tasklet_rx, atmel_tasklet_rx_func); + tasklet_setup(&atmel_port->tasklet_tx, atmel_tasklet_tx_func); /* * Initialize DMA (if necessary) From patchwork Mon Aug 17 08:59:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 258133 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 275D7C433E1 for ; Mon, 17 Aug 2020 08:59:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F0B4C207DF for ; Mon, 17 Aug 2020 08:59:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eqHEvOD6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728307AbgHQI7w (ORCPT ); Mon, 17 Aug 2020 04:59:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728739AbgHQI7q (ORCPT ); Mon, 17 Aug 2020 04:59:46 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CDA6C061388; Mon, 17 Aug 2020 01:59:45 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id 128so7801407pgd.5; Mon, 17 Aug 2020 01:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bfbk6qu+Dh0r09/BC2HVXkZhe9/6tVYt11hNr0Vm+DI=; b=eqHEvOD60MZgX5QZiePO/SspTddcQhdgDeNCR0Mu0EohogFtoim9ZkpjIFOkxExKkV GcXVa3oznDDxllthJndBo0kfvWz7VfsWVYM29+Efm6v+9NIBXW4oqCm5P1PyrK+NYpd+ 9bmcq7UrAawZ2temd47NpyFCLPMwIvmx0FvUf4WNbQ3P46MunRJUvSzick/BSb5onCWf pUyDwHsKJrMBe4XRtdo6RMydJkB89oFjWH7ubvmVKtxkHsKDJE1gwVmpNtwyGzYUyvG7 m/kOhs50nXk+/R+4pEyb+x+3OOzw/Di520QgWIpIR7WzYdlXiOIhUoqwM9F1NMGZ1lP4 M5qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bfbk6qu+Dh0r09/BC2HVXkZhe9/6tVYt11hNr0Vm+DI=; b=jBan3AII1a1k/uPxJQxtuPjJFWdqtR15d3kgAY7L/suP1/WHGXojgqHE3/IOitofT+ PMFxjKZks8cfqgmsAJ56QJmQjUCBopQOkzC360LS+JLV1Abu/IrBFblAQnGKwF+GTcUG zTd6iVe97QuXJ6T6Vaa314OoPeIS1Acq/NDJvfQzkOHtnKr8Gs5Ke30QbTrlJl6d5V90 d2dy+2bCnsJb08wRZXVPjDYu9kZ5mPxssLldqvgUmT3aQJUwUZo1lbUe3YGusLxvWvXH Gbt/zM4PMhaGlOOcUSDUFw9jY+EHUoAUl0d/0f8Ib1FHUff9HC19SwaNHUWONxCZcCRn oBcA== X-Gm-Message-State: AOAM530MvAGjMNso68NmXcKkY84RKxNRhvyyYiaVlafPyhDp1VICT9yH 0FXd2x0/z1HZ/kpf6/Qu9EpsK6A5BPnUvA== X-Google-Smtp-Source: ABdhPJwbOUjxkSKQIB51eMU9r5yw0K1XtQNm4cXz6JwSEOXlV6ZMtYAd8hVyZnS9wqz7EYBa7vpvLg== X-Received: by 2002:aa7:8c42:: with SMTP id e2mr10278896pfd.181.1597654785029; Mon, 17 Aug 2020 01:59:45 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id j13sm18508547pfn.166.2020.08.17.01.59.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:59:44 -0700 (PDT) From: Allen Pais To: richard.genoud@gmail.com, gregkh@linuxfoundation.org Cc: keescook@chromium.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Allen Pais , Romain Perier Subject: [PATCH 4/4] tty: timbuart: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:29:21 +0530 Message-Id: <20200817085921.26033-5-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817085921.26033-1-allen.cryptic@gmail.com> References: <20200817085921.26033-1-allen.cryptic@gmail.com> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/tty/serial/timbuart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/timbuart.c b/drivers/tty/serial/timbuart.c index 19d38b504e27..2126e6e6dfd1 100644 --- a/drivers/tty/serial/timbuart.c +++ b/drivers/tty/serial/timbuart.c @@ -172,9 +172,9 @@ static void timbuart_handle_rx_port(struct uart_port *port, u32 isr, u32 *ier) dev_dbg(port->dev, "%s - leaving\n", __func__); } -static void timbuart_tasklet(unsigned long arg) +static void timbuart_tasklet(struct tasklet_struct *t) { - struct timbuart_port *uart = (struct timbuart_port *)arg; + struct timbuart_port *uart = from_tasklet(uart, t, tasklet); u32 isr, ier = 0; spin_lock(&uart->port.lock); @@ -451,7 +451,7 @@ static int timbuart_probe(struct platform_device *dev) } uart->port.irq = irq; - tasklet_init(&uart->tasklet, timbuart_tasklet, (unsigned long)uart); + tasklet_setup(&uart->tasklet, timbuart_tasklet); err = uart_register_driver(&timbuart_driver); if (err)