From patchwork Mon Apr 17 07:55:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 674008 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40BCDC77B76 for ; Mon, 17 Apr 2023 07:56:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231224AbjDQH43 (ORCPT ); Mon, 17 Apr 2023 03:56:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231169AbjDQH4C (ORCPT ); Mon, 17 Apr 2023 03:56:02 -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 977593AB6 for ; Mon, 17 Apr 2023 00:55:59 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4ec9ccab8bbso1203367e87.2 for ; Mon, 17 Apr 2023 00:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681718157; x=1684310157; 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=WctxKpomw5MLFuTazOUJElliLOUHb46B+NNI3oGGJOk=; b=nrm3vCoDnCsGk5roNJOkOPJb/qrgzSDL7HZTpjuS0DYFM6k0XGk3ilID4Iatv3LMvT U8XRVJCyLpQPX9QHRfpxzhPr+M0L7uNCX/jXSFPGuAct/7na75uNhvspwNSp+NPOOgy2 c5sf/zmkK6CZ4sSFs4FPA+pTrK5+A6eQfN2XMWFzbyvyf0fKZzzaenFoeKS3LNFBdHez 7Cpjj8F9/dvQDjk24cKykEUjvRQCrPGJwkXmFFL2E04fQ0gOv9h34nIfWleyj3Q+tie1 6lbhupaT40ktTPvKuE2LOCfoE9spvTMDf8WK04iGb50AQ3vq605S/bKk3klAWPhdAT0S muzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681718157; x=1684310157; 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=WctxKpomw5MLFuTazOUJElliLOUHb46B+NNI3oGGJOk=; b=Q8BdlXZ4oLVae4dvGKYH6WewBHhXvOH0qvrNHapQ9akVII5/K6dcRno7WaJnpYlkfq ncg7VIsZusHiDcFECeSwwjYe+eNquyrQq9JwvAmzja6wOBKJGo90Dy8FvKspAdJycavl E833lEifxY5D+RO3KTS9Hw2y1mJ/NAzMv0ipIkNZ3gBB8RWQizT4f9YvcObsqedpUZvI BRQBjIH12hntmK0epsOnAi+nZ4w/1r3CWp85oYVMhzo6vKQGCg8nimLdgZXrXhD6VDZJ nCt0N3/W+QHpReE+MoWs7w3qNsAnGTRMqdMACJ9s5DdZfv5ATefNE415tIiDfS/FowAZ AP8Q== X-Gm-Message-State: AAQBX9dzkz8zUfknj1l/N4wk1TnKFgv48r7yaisIyeQ0Gv6mKl8Z9rOA qdXKoobpUNsBVB0wd4YFJ6Sus4fro4lzAAFvd0s= X-Google-Smtp-Source: AKy350brBnsZQMq3FHoLYXhVv31Cc/XfOFRTXUTswulWQSeew8raaiwxMvUBRANzUX5EgIbKWZTllw== X-Received: by 2002:a05:6512:924:b0:4eb:274b:a69 with SMTP id f4-20020a056512092400b004eb274b0a69mr2163114lft.26.1681718157639; Mon, 17 Apr 2023 00:55:57 -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 p2-20020a19f002000000b004eb274b3a43sm1952547lfc.134.2023.04.17.00.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 00:55:57 -0700 (PDT) From: Linus Walleij Date: Mon, 17 Apr 2023 09:55:50 +0200 Subject: [PATCH 5/7] dmaengine: ste_dma40: Pass dev to OF function MIME-Version: 1.0 Message-Id: <20230417-ux500-dma40-cleanup-v1-5-b26324956e47@linaro.org> References: <20230417-ux500-dma40-cleanup-v1-0-b26324956e47@linaro.org> In-Reply-To: <20230417-ux500-dma40-cleanup-v1-0-b26324956e47@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 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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 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; }