From patchwork Tue May 16 12:55:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13243138 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1CA6BC7EE2A for ; Tue, 16 May 2023 12:56:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=15aTco8IjLFVb+bdzrftUb0AvOqDwP5xGa2+JoRbQF4=; b=dvSwVCb4JRyUHX mO19mdCQrmua4+BubIKoTbLq3IFsSqaxby1YcIkaVWh44KacvyMv/Yo3HZZRmRKVlzXe9HFF7+WE/ OnNCtiRfiN5bg1Wr2LotRQHCTjcwHFh+RLYKe8idBC+wiKXzQeAwQPvc6sLF8bW41mhUhDrJvrQ4J ukc19Dpq0srZTBBw7j672ZrAAxDMp+jmqoEn7kpQJtFu2HIOs+SYqp/CVUw9b0gE5dxmneVaDK8/P gipCyWPMlV+1R38/mouWot+iIMT0SoeRgP2kxa4WiM/NmNYgXIAlApxjmq7AbAZKaTVgsM64iXyNa lZqItG7SREnj4cB2P6Ew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyuDY-005nxv-09; Tue, 16 May 2023 12:55:52 +0000 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyuDS-005nuJ-2b for linux-arm-kernel@lists.infradead.org; Tue, 16 May 2023 12:55:48 +0000 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2ac7c59665bso153019781fa.3 for ; Tue, 16 May 2023 05:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684241745; x=1686833745; 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=CXDujZjOmn14EqjwMZcmym6IEUeRVyRNkVM6UCS7Ld4=; b=k1m1MrvGvq5UvjWEb3hZnJWob9bx/nsIVHunAtM9VFyioxd759fGt1mhyGiMgAT+uO 8RVl3mKIdHywmcC6Y4Zlu0h4qDZdBGDXirdUKysfV0bzhpkDDWAEazste7YOqjKF5K+m ytPHrDbprC1nF75ovu23TCFzZPoRjPPlJ8DkBRm53mitT9o9R1LEEEScazLdKcANfhS6 WToWOgO6PaiW/Iz1o7MgDvtS1HYSxsw//7LnsKYXXf+qKABN+gG07o7ZjPSJQscExk3T Ue7jxwAW2vvpkWNh4jjs2nDamyCzkA4z1K2NCSLQSuXTAqB3HgOvW4V8u9eO9KLusiUe PebQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684241745; x=1686833745; 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=CXDujZjOmn14EqjwMZcmym6IEUeRVyRNkVM6UCS7Ld4=; b=N7mpRCw0PRmXxlOcxlleV07NqtA+BvsYzS2mkhdZkk7HG9ALcO3SVbUGGm2Fr7yO3H pWHMf0ynEPvmh9xE77cKC4dhvaNwMhiOepTolOFEp68mohMFj7fgk0e+5YY3qBjCQhKG 2SsXP4bLl53cMORkejG1Z5KlO/37c/npefNcs73HJiCGquoyvTDJSDwjDUJnW6zkLk0Q hRNPsyn0UuxKwi5RXQ2q5ff2MGPcjTNJafqoeGuoe0dEqCYXWaPmvgX51f2OSX6sRyeB 58piciG6sIIKIxAaUaLk6rCoEgK0xXtzQTmvsD2FRMS0BnAtBDj7ZjxjGtguhIPVL4Wt Hqog== X-Gm-Message-State: AC+VfDwsC2UwwdNJmSEyKAoJ6G/5OOkQKAV/NdJBcsAkHifScFKlyfIg kGaPnn37ua7lQ5NaqBVlbGYzOA== X-Google-Smtp-Source: ACHHUZ4FC9snn34bdwiHmnmhxll/Nmpcg9xoRfCJ8p24i6clsi+U4FrZaYbVvn9ePp12VgQZln39MQ== X-Received: by 2002:a2e:9d97:0:b0:2ac:d51f:2d60 with SMTP id c23-20020a2e9d97000000b002acd51f2d60mr8540364ljj.33.1684241744893; Tue, 16 May 2023 05:55:44 -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 o23-20020a2e7317000000b002add1f4a92asm1647789ljc.113.2023.05.16.05.55.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 05:55:44 -0700 (PDT) From: Linus Walleij Date: Tue, 16 May 2023 14:55:35 +0200 Subject: [PATCH v3 5/7] dmaengine: ste_dma40: Pass dev to OF function MIME-Version: 1.0 Message-Id: <20230417-ux500-dma40-cleanup-v3-5-60bfa6785968@linaro.org> References: <20230417-ux500-dma40-cleanup-v3-0-60bfa6785968@linaro.org> In-Reply-To: <20230417-ux500-dma40-cleanup-v3-0-60bfa6785968@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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230516_055546_843416_9B03EE8F X-CRM114-Status: GOOD ( 16.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 48c9606cfd46..87f57457e4d9 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; }