From patchwork Thu Apr 27 12:10:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 88232 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp224001vqo; Thu, 27 Apr 2023 05:18:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5DVsQN7tL/3kl6Kg3B47bSlVKH+BKM4LjhEZLIbY5/HgzaOpb8+UEcFNuWgwM53Iv5NVTR X-Received: by 2002:a05:6a20:6f03:b0:f5:a437:26f with SMTP id gt3-20020a056a206f0300b000f5a437026fmr1617949pzb.18.1682597883396; Thu, 27 Apr 2023 05:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682597883; cv=none; d=google.com; s=arc-20160816; b=UA4Cs+hM8q2mTvx03Ys1X+WaCbz0BZoBFX4Xl5QzcASM1eEvUuuq0zc5O+vVSmrDSh Y4dgPjSBQ2EUCdq1Rlnz3iaiGr/1LhcMzKnzlklvomNT4nizRgCmOpFfjYE4OXNEtdyW 0da0n9aFgv2jousgo4akj2+I/EamwPUSTu+wd3pqMCpJltdpI8Yn/P9ic/kino/HDocf b1a5hEZbS4CMgru5Sl+4SntH6hOAvEWL3qlTegpH6jNzWH8lZ94HOLnjEsezV94kxKq5 dKo4s5iVyBojBu0Lb+WfgtGiZYOmbriwZk4ezDWzLE2XbQPXZgY+Sn/T3j2e0+v+o50Q AOaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=pNvCCMPMF278Wqr3jAy5GhuoPQm5kPBgkMVcgaYk7hs=; b=b8gf+Te7rrt+jf12wGu86QpzabgpKioLauBIvIee5Hnh75Br4hyQ4mpgBjUbrThsWX lodra1xc5/dv28GwpLobAqbrTdL7j0MiJbUDEGo0O9qdKCpZ+whN4+l9pHNaZ9zv560b OM4AzjauvOi9+jccMVCHUS0gHgkZB+SQ8syvAr+vPSxqIwehNFI0pYNZ6YbAU1NK0nq2 bTMf3pwm2gmE/3ElsJP8WHqA7Dr3DHy7XpiM5BTOU1SUexQABrAhtWeDGR5HyRVtcAbp 8fv6ZVbtNp8zVuQ/27pg98iaLE0/OqNqSR3Mne/c8iqYG4Vg9bONazwaUDhR4IW401v7 eq4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kzyVHrQB; 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=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w5-20020a63fb45000000b0051453dfd139si18595682pgj.613.2023.04.27.05.17.50; Thu, 27 Apr 2023 05:18:03 -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=@linaro.org header.s=google header.b=kzyVHrQB; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243821AbjD0MKU (ORCPT + 99 others); Thu, 27 Apr 2023 08:10:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243754AbjD0MKH (ORCPT ); Thu, 27 Apr 2023 08:10:07 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEC32524F for ; Thu, 27 Apr 2023 05:10:05 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f004943558so2404685e87.3 for ; Thu, 27 Apr 2023 05:10:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682597404; x=1685189404; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pNvCCMPMF278Wqr3jAy5GhuoPQm5kPBgkMVcgaYk7hs=; b=kzyVHrQBPyLbh7Z7H9tNdb7DTY2g7oozYbJpteZq3a4GM52Ed4wUr0jSg76ineFNmB 8Fd3VSBeUZoQbr4P25HBYfhnF8E24xT7KYf+OCFoXfO3hgdXAktHyrLzP290wxZLmxIL tCdiCoA5hdLspOIEMV/a9m+iKX/2Dww3tsGq7X5ZDH0PO7aql7YKmuwuBrVklRER6xO/ NjDtuX2NNZwTNy1sQ5rqxB4uaf5zoI6Z7f1PDf7R/sHfqzFy5u+Cdw3WFhEn3XiZmVCG CCJ1e1uIA3BVYj8cTRWJEmaPpTNyb9nvTM5lBG9cpQ4shI1iR9DiTSDUUDG38d/EE9Yo x2IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682597404; x=1685189404; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pNvCCMPMF278Wqr3jAy5GhuoPQm5kPBgkMVcgaYk7hs=; b=VtjOlg19s64rgtHVho4wmx+yx9shmhrWlq2nyOJY87ibGP2kQYsjoKN0tXJ+bZeQxB kKQDvjf6iKa1KQ3VLE4pVROv+kO3ngHwxcmGDDiAFF95fsZygZqp/Go+CpusGaAHORlg ikzb3RvwtCZee1pr9MhwwflEJA3hjf8QHhsEVd3brTUVrHF132uEAUjuop3FBCYaBH0O 1tLKalk9LtYTPWupchnm99ld2zQ49V7KuDCRz+PA/ktCfP4zz90zZCBu1guzqmWbDJf7 j86enqXAAog4l0CVHOiLJ9e0d9ZpYVQpUu66kNdlVUjTcyou9u2nd5C92V2g9SBLBX71 T3AA== X-Gm-Message-State: AC+VfDxG9dNc0NkIcZpCLTzhRJKfj2bxtd0QxdQw15efVquZuVV9GqiS f/r0gEmdVl8j4RjhL0NCy2nJSQ== X-Received: by 2002:ac2:48b3:0:b0:4ef:f630:5c1e with SMTP id u19-20020ac248b3000000b004eff6305c1emr491617lfg.51.1682597404231; Thu, 27 Apr 2023 05:10:04 -0700 (PDT) Received: from [192.168.1.2] (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id e7-20020ac25467000000b004d4d7fb0e07sm2892044lfn.216.2023.04.27.05.10.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 05:10:03 -0700 (PDT) From: Linus Walleij Date: Thu, 27 Apr 2023 14:10:00 +0200 Subject: [PATCH v2 5/8] dmaengine: ste_dma40: Pass dev to OF function MIME-Version: 1.0 Message-Id: <20230417-ux500-dma40-cleanup-v2-5-cdaa68a4b863@linaro.org> References: <20230417-ux500-dma40-cleanup-v2-0-cdaa68a4b863@linaro.org> In-Reply-To: <20230417-ux500-dma40-cleanup-v2-0-cdaa68a4b863@linaro.org> To: Vinod Koul , Rob Herring , Krzysztof Kozlowski Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linus Walleij X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764331757792701503?= X-GMAIL-MSGID: =?utf-8?q?1764331757792701503?= The OF platform data population function only wants to use struct device *dev, so pass that instead. This change makes the compiler realize that the local platform data variable is unused, so drop that too. Signed-off-by: Linus Walleij --- drivers/dma/ste_dma40.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index e5df28cdc4c8..fe98f12b8130 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -3480,14 +3480,14 @@ static int __init d40_lcla_allocate(struct d40_base *base) return ret; } -static int __init d40_of_probe(struct platform_device *pdev, +static int __init d40_of_probe(struct device *dev, struct device_node *np) { struct stedma40_platform_data *pdata; int num_phy = 0, num_memcpy = 0, num_disabled = 0; const __be32 *list; - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); if (!pdata) return -ENOMEM; @@ -3500,7 +3500,7 @@ static int __init d40_of_probe(struct platform_device *pdev, num_memcpy /= sizeof(*list); if (num_memcpy > D40_MEMCPY_MAX_CHANS || num_memcpy <= 0) { - d40_err(&pdev->dev, + d40_err(dev, "Invalid number of memcpy channels specified (%d)\n", num_memcpy); return -EINVAL; @@ -3515,7 +3515,7 @@ static int __init d40_of_probe(struct platform_device *pdev, num_disabled /= sizeof(*list); if (num_disabled >= STEDMA40_MAX_PHYS || num_disabled < 0) { - d40_err(&pdev->dev, + d40_err(dev, "Invalid number of disabled channels specified (%d)\n", num_disabled); return -EINVAL; @@ -3526,7 +3526,7 @@ static int __init d40_of_probe(struct platform_device *pdev, num_disabled); pdata->disabled_channels[num_disabled] = -1; - pdev->dev.platform_data = pdata; + dev->platform_data = pdata; return 0; } @@ -3534,7 +3534,6 @@ static int __init d40_of_probe(struct platform_device *pdev, static int __init d40_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct stedma40_platform_data *plat_data = dev_get_platdata(dev); struct device_node *np = pdev->dev.of_node; struct device_node *np_lcpa; int ret = -ENOENT; @@ -3544,7 +3543,7 @@ static int __init d40_probe(struct platform_device *pdev) int num_reserved_chans; u32 val; - if (d40_of_probe(pdev, np)) { + if (d40_of_probe(dev, np)) { ret = -ENOMEM; goto report_failure; }