Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2127953pxa; Mon, 17 Aug 2020 01:15:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9AIhatv5lW7p2RaoDQ6fOg1oTt+/fLMBcUoHASDXuPAErYbk1NypBbUBQ1tMpG/gwxs0+ X-Received: by 2002:a05:6402:1845:: with SMTP id v5mr14185907edy.66.1597652134326; Mon, 17 Aug 2020 01:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597652134; cv=none; d=google.com; s=arc-20160816; b=l2dmID8+XW9hRPnko3z8UCToV3KSJXEtOIAFHW1D8Q6TzEk1/ybQe4KwNX3nLk+DD4 ibzgLjjkrFtZjdwVoYb1c5tcyXKapDwnj/cnqV2jzwZ+jv4oAwooUVbITHClK2NZb5am TuWi3tSKFI6gVcpzkvCoG+PeX08y6zkxyXe7ZVtMjEfWaVYYJuJIn7ay8YFGz2tzYVsj YDN0Er5HomZFy/tqQTYr39ZDz6ShNbwfOuHIlBQbun8csXVdFOGOHX8m1WmLtKh0j08v O0wQQ54OpkdIbOnnFNl+SZ5lwPEWsJQnepJEO3ZeKPHSQE5JiCR84BrqA2NzQvBAehXJ rVXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=igR/75gxadmtMWi9MLkMfLLU0IUv0P9kjxxPayYPRNc=; b=fePmgLb+OBYUtI8WR31/WF9DTSKa4Evw3fXnvJQ1n5++QeKS8yS0hXmEmSmX1k6Wcg fHgvlPuCauMbGAXx8A1UsTnfLjAsBkubbylLiKKYLXf8lhYoumHLhQiWyGgYPTOQnxx4 vjToMDsRmG+iv7SXlsTFq+oM/bFrw/S3XbPJPr1dJ6voup6232Wo19oIB7MJrquRiV6x OJZ83AxIubHYQmWOTm3m0eEkGQPI2FfgfU5Jm2VaA07T7dCGAVZtxIflUD2MPJirZ1+8 zspnISTNa3PPa4xzUY9dll1g8ZkpYbNyGpgbZSPVCb7cHnpug2IN9FZy+K+FrWKU3g9O zdsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C8Stt0Ol; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qw24si10496028ejb.416.2020.08.17.01.15.11; Mon, 17 Aug 2020 01:15:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C8Stt0Ol; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727961AbgHQILo (ORCPT + 99 others); Mon, 17 Aug 2020 04:11:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727902AbgHQILY (ORCPT ); Mon, 17 Aug 2020 04:11:24 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41120C06138A for ; Mon, 17 Aug 2020 01:11:23 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id a79so7844581pfa.8 for ; Mon, 17 Aug 2020 01:11:23 -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=igR/75gxadmtMWi9MLkMfLLU0IUv0P9kjxxPayYPRNc=; b=C8Stt0OlJzlkc6BUmSvLpowDIaQDIjMoBeWtXArari9zGfvxvs69bK6rIOYcHidnxL FNqKY9k4Dc2qknAn0rwYORoNYLIevPVUaTyGpky1jzUzxcewRYgV1iP6yDu8EYr3cKXg cE6Lz3EkRB1oKuR6L5bXfe/HEHI/K9Oc85allpXmSSU/xQUpE66GsanpaDM4zCTATb8c tjEGO834txneUa7AMWjcT4ht3zwMUYmG5tFFeucrRg0z5GNq23ZgiCy4YlAyr1Lycho9 QbeBA1e6Q/NgXVSqgRk7KGdNEuBkvp5z5rALg635boIFg1PgshxFBzdsNDr4SVkVVrYA 6UCA== 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=igR/75gxadmtMWi9MLkMfLLU0IUv0P9kjxxPayYPRNc=; b=Mb8VFiw5wPAptEWGEdDmrKvaCOyhe59OKWpcGfH3gPR33N3rgTPsnuss/gEHQaMzdb M4mOg8m52VmIXs5UPRVEgBvLWixteAhhBeCApZOx3VdZc378Mpk6OYQXOqHg0c1C/0YO CvADgSexJ0pd4DIiqKY/jHwRhe5mhqwblFK5UHXtYgMMBEI6/pdojKf6DnBoj9KDm0Lv 19Nmy1+vhy2fJxmujyZdx+mfXgBG0j+q38Y6hQ6GhniEygJPRm7msaSRHd31+HK1xL3e TO5Qq0IRV8d1jdyprcdwFLeImN4xi8mN5Vgz4rHY2CjPAXVuHLvO7njl4ywsAu8rv7wP euBg== X-Gm-Message-State: AOAM53202/CS0KoVXhSawd9rbBQjbir/Xx7xRmapx3nBMeZqev4FAPAb /VGIbt9ZYkSzib5XYXlqPFM= X-Received: by 2002:aa7:9e45:: with SMTP id z5mr10816004pfq.166.1597651882821; Mon, 17 Aug 2020 01:11:22 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id 77sm18499751pfx.85.2020.08.17.01.11.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:11:22 -0700 (PDT) From: Allen Pais To: nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, ludovic.desroches@microchip.com, heiko@sntech.de, matthias.bgg@gmail.com Cc: keescook@chromium.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, inux-mediatek@lists.infradead.org, Allen Pais , Romain Perier Subject: [PATCH 18/19] crypto: talitos: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:39:40 +0530 Message-Id: <20200817080941.19227-19-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817080941.19227-1-allen.lkml@gmail.com> References: <20200817080941.19227-1-allen.lkml@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/crypto/talitos.c | 42 ++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 7c547352a862..6d729af1f8e4 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -402,10 +402,11 @@ static void flush_channel(struct device *dev, int ch, int error, int reset_ch) * process completed requests for channels that have done status */ #define DEF_TALITOS1_DONE(name, ch_done_mask) \ -static void talitos1_done_##name(unsigned long data) \ +static void talitos1_done_##name(struct tasklet_struct *t) \ { \ - struct device *dev = (struct device *)data; \ - struct talitos_private *priv = dev_get_drvdata(dev); \ + struct talitos_private *priv = from_tasklet(priv, t, \ + done_task[0]); \ + struct device *dev = priv->dev; \ unsigned long flags; \ \ if (ch_done_mask & 0x10000000) \ @@ -428,11 +429,12 @@ static void talitos1_done_##name(unsigned long data) \ DEF_TALITOS1_DONE(4ch, TALITOS1_ISR_4CHDONE) DEF_TALITOS1_DONE(ch0, TALITOS1_ISR_CH_0_DONE) -#define DEF_TALITOS2_DONE(name, ch_done_mask) \ -static void talitos2_done_##name(unsigned long data) \ +#define DEF_TALITOS2_DONE(name, ch_done_mask, tasklet_idx) \ +static void talitos2_done_##name(struct tasklet_struct *t) \ { \ - struct device *dev = (struct device *)data; \ - struct talitos_private *priv = dev_get_drvdata(dev); \ + struct talitos_private *priv = from_tasklet(priv, t, \ + done_task[tasklet_idx]); \ + struct device *dev = priv->dev; \ unsigned long flags; \ \ if (ch_done_mask & 1) \ @@ -452,10 +454,10 @@ static void talitos2_done_##name(unsigned long data) \ spin_unlock_irqrestore(&priv->reg_lock, flags); \ } -DEF_TALITOS2_DONE(4ch, TALITOS2_ISR_4CHDONE) -DEF_TALITOS2_DONE(ch0, TALITOS2_ISR_CH_0_DONE) -DEF_TALITOS2_DONE(ch0_2, TALITOS2_ISR_CH_0_2_DONE) -DEF_TALITOS2_DONE(ch1_3, TALITOS2_ISR_CH_1_3_DONE) +DEF_TALITOS2_DONE(4ch, TALITOS2_ISR_4CHDONE, 0) +DEF_TALITOS2_DONE(ch0, TALITOS2_ISR_CH_0_DONE), 0 +DEF_TALITOS2_DONE(ch0_2, TALITOS2_ISR_CH_0_2_DONE, 0) +DEF_TALITOS2_DONE(ch1_3, TALITOS2_ISR_CH_1_3_DONE, 1) /* * locate current (offending) descriptor @@ -3385,23 +3387,17 @@ static int talitos_probe(struct platform_device *ofdev) if (has_ftr_sec1(priv)) { if (priv->num_channels == 1) - tasklet_init(&priv->done_task[0], talitos1_done_ch0, - (unsigned long)dev); + tasklet_setup(&priv->done_task[0], talitos1_done_ch0); else - tasklet_init(&priv->done_task[0], talitos1_done_4ch, - (unsigned long)dev); + tasklet_setup(&priv->done_task[0], talitos1_done_4ch); } else { if (priv->irq[1]) { - tasklet_init(&priv->done_task[0], talitos2_done_ch0_2, - (unsigned long)dev); - tasklet_init(&priv->done_task[1], talitos2_done_ch1_3, - (unsigned long)dev); + tasklet_setup(&priv->done_task[0], talitos2_done_ch0_2); + tasklet_setup(&priv->done_task[1], talitos2_done_ch1_3); } else if (priv->num_channels == 1) { - tasklet_init(&priv->done_task[0], talitos2_done_ch0, - (unsigned long)dev); + tasklet_setup(&priv->done_task[0], talitos2_done_ch0); } else { - tasklet_init(&priv->done_task[0], talitos2_done_4ch, - (unsigned long)dev); + tasklet_setup(&priv->done_task[0], talitos2_done_4ch); } } -- 2.17.1