From patchwork Wed Aug 29 21:32:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 10580947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4F76D139B for ; Wed, 29 Aug 2018 21:33:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 407792BB5A for ; Wed, 29 Aug 2018 21:33:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 346202BB69; Wed, 29 Aug 2018 21:33:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D88772BB5A for ; Wed, 29 Aug 2018 21:33:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727086AbeH3Bb5 (ORCPT ); Wed, 29 Aug 2018 21:31:57 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:52464 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727042AbeH3Bb4 (ORCPT ); Wed, 29 Aug 2018 21:31:56 -0400 From: Paul Cercueil To: Vinod Koul , Ralf Baechle , Paul Burton Cc: od@zcrc.me, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, Paul Cercueil Subject: [PATCH v5 02/18] dmaengine: dma-jz4780: Return error if not probed from DT Date: Wed, 29 Aug 2018 23:32:44 +0200 Message-Id: <20180829213300.22829-3-paul@crapouillou.net> In-Reply-To: <20180829213300.22829-1-paul@crapouillou.net> References: <20180829213300.22829-1-paul@crapouillou.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1535578387; bh=PNd48fB1tNSfs9eaRrl14SKjrUVfpS2KU5/99En1wT8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=IYv2rOB/lmeHQQLYep5MhYD2m7GBU+3RVtoSNIQH8rabOmNyuce89Z4SC5XuKprGoY7/8I2eybhqtP8ReaT18C4Ykc56mx1AdyuyNyC4kzY9dE8+zZoIpb3Z9NS8uTKjVMUVTBO7fNbIxP6lTqIrEZdYBEkniC/FECYjPwdkysY= Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver calls clk_get() with the clock name set to NULL, which means that the driver could only work when probed from devicetree. From now on, we explicitly require the driver to be probed from devicetree. Signed-off-by: Paul Cercueil Tested-by: Mathieu Malaterre --- Notes: v2: New patch v3: No change v4: No change v5: No change drivers/dma/dma-jz4780.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c index 85820a2d69d4..987899610b46 100644 --- a/drivers/dma/dma-jz4780.c +++ b/drivers/dma/dma-jz4780.c @@ -761,6 +761,11 @@ static int jz4780_dma_probe(struct platform_device *pdev) struct resource *res; int i, ret; + if (!dev->of_node) { + dev_err(dev, "This driver must be probed from devicetree\n"); + return -EINVAL; + } + jzdma = devm_kzalloc(dev, sizeof(*jzdma), GFP_KERNEL); if (!jzdma) return -ENOMEM;