From patchwork Mon Dec 27 12:05:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12699720 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 C65D4C433F5 for ; Mon, 27 Dec 2021 12:10:29 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ImHlmrT+ZTakv2kT7z6u0AbEa9uJy/R+iyqnL0zmqV4=; b=antIodvvppMugj ahMRvuqX/cTO5KUB8aChZyGQ0C9NWxaHUtlEsKggY4zJsoGOd2fstizMuu2F8ryl7ZPCEofM/sDVm C/o73f/FxbYgOc9HZz5+B+BXj6MvMHxRzBiYdTZTdD884xoORzHqJq1/OT3WuFiEDcyWQf7Mya0yx HsygNUbx5DZRiIKO1l53wY9vz4poNhJ0a0ZGX3obNzrzGfJf9bgh1aRVqHXrJXjn21qBwFv0mQUxh fcIsJnWwkML7k3C0zLvG69krH8+i94ojzdOxCc22IsOjol4e88OmybygkrEh2MR+TD7J/6R0Qzha9 6TTZHirljYXYd/OgXR4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n1ooH-00Gcxm-FM; Mon, 27 Dec 2021 12:09:01 +0000 Received: from mout.kundenserver.de ([212.227.126.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n1oli-00Gbss-Ms; Mon, 27 Dec 2021 12:06:30 +0000 Received: from localhost.localdomain ([37.4.249.169]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MryKr-1mgUEN17Ez-00nx3N; Mon, 27 Dec 2021 13:06:14 +0100 From: Stefan Wahren To: Vinod Koul , Rob Herring , Florian Fainelli , Nicolas Saenz Julienne Cc: Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, dmaengine@vger.kernel.org, Phil Elwell , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Lukas Wunner , linux-rpi-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH RFC 03/11] dmaengine: bcm2835: Support common dma-channel-mask Date: Mon, 27 Dec 2021 13:05:37 +0100 Message-Id: <1640606743-10993-4-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1640606743-10993-1-git-send-email-stefan.wahren@i2se.com> References: <1640606743-10993-1-git-send-email-stefan.wahren@i2se.com> X-Provags-ID: V03:K1:pLYG2yJd/86QSRmuXUNXZ0jIhtsFv1rfHEN2cSa9TfrRHXAWO4l aNYr2qJeom3SA27zUgKi6qnIgcL0rjTmq/0FDmy2SMlwHx+4AP4XCT2c+qwQexjMvOGKiS1 JTOEQAVEPBUUr7BwZuH4qT2h5SQSpVcrYOJGgtzQeMj6za1WG8IyO+YLj0eiNSrC6IMJn1p /9/wtHXceaKFfdeRcVerA== X-UI-Out-Filterresults: notjunk:1;V03:K0:J6uy7lC+pS8=:/R/8iW/sI1gAwBu30ljRSk jXqZfVAjxRgtDwM6cRkToPx1ynXW1wFJyh2Q8H6djqi5HwsK6+pWX7jNZxor3t/2fo9MCuUfM rdZB1ykQt+N0FEXMK3mdHYizMURtO+BSmLYspKcZ0vIpcFhvBMHX0ycUL26VeA7jkPiJFncic f+Ka9dvWLA0mVfXzCj9EZrxMFs+n3yv0uignNRzEaCGdELeYtl/YCc+KvkVhFw+/XiRyoUyQj Cd2uCaEfJwk1wQ5ZL65s3VkfiaqRHeDrp4Jv1ofgP6IgQkTikTcvgBTZ2GXWjx5zyOz0Ole3y y8sfH/vTdHcI7K4VmibkdOoZF+N3wDb7Gbb4Z7sRvahfDEWLgNYIg4ptytQ3ETlm2HoDiZvEE VAJ/4KDo5CGzT4syfC+Dap4JifeJyisc2+jKh7nQr4xgXRH43v0F7lWEo5mF2NWWejLa1WzcD Iynxj2lVGYcgIHrXdabARmmex3qUKUO8lLMMw0onmbYnZ0rBWgkKudnKHU/TERUf0hfHypZdm ThOjjCfvl+FzUGDahA5QUjFNZsVKhwC8/XFMoJkqX1txAaifmUyhXIBM6EsDzlQT2TkF14DvY gPl6ZGy55KN1sqQRjrsFFFcTxmwG/RkYtZtEvOT1xejCmgIVYKTLeGXot58eR+8jcAhHfJT+m 0dEUMkp5yNzRpRCM7qpVRlb+RZ4gyovXbshezgG0SIQY4pJ/+pMTmN9hIy2J1kqsuQejM3JX8 5l6ykr9GibWR8/6H X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211227_040623_137914_BB583E42 X-CRM114-Status: GOOD ( 13.62 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Nowadays there is a generic property for dma-channel-mask in the DMA controller binding. So prefer this one instead of the old vendor specific one. Print a warning in case the old one is used. Btw use the result of of_property_read_u32() as return code in error case. Signed-off-by: Stefan Wahren --- drivers/dma/bcm2835-dma.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c index 630dfbb..adfe6bc 100644 --- a/drivers/dma/bcm2835-dma.c +++ b/drivers/dma/bcm2835-dma.c @@ -943,12 +943,19 @@ static int bcm2835_dma_probe(struct platform_device *pdev) } /* Request DMA channel mask from device tree */ - if (of_property_read_u32(pdev->dev.of_node, - "brcm,dma-channel-mask", - &chans_available)) { - dev_err(&pdev->dev, "Failed to get channel mask\n"); - rc = -EINVAL; - goto err_no_dma; + rc = of_property_read_u32(pdev->dev.of_node, "dma-channel-mask", + &chans_available); + + if (rc) { + /* Try deprecated property */ + if (of_property_read_u32(pdev->dev.of_node, + "brcm,dma-channel-mask", + &chans_available)) { + dev_err(&pdev->dev, "Failed to get channel mask\n"); + goto err_no_dma; + } + + dev_warn(&pdev->dev, "Please update DT blob\n"); } /* get irqs for each channel that we support */