Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3824515imm; Sat, 21 Jul 2018 04:09:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcnfUxcjwz6Q5MoqtxqEXcag36FTR5cZIYuI7K28oZEqFV8NQsfzezUj0zh/z1WRKVkmWis X-Received: by 2002:a17:902:42e4:: with SMTP id h91-v6mr5444557pld.27.1532171371628; Sat, 21 Jul 2018 04:09:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532171371; cv=none; d=google.com; s=arc-20160816; b=sO5L+ufYCupnTN6RKSWCi1qPv7XBQfAySlqnF0V+ynOTIcKMxbu9vhhi90XYQ6SxfA Pu/5qo0oraGXYVX+WGqZyt2JYYuUPUlkAbXPzVn6KhzJC706cApLlSPqUBzm0RqeSrQk fe4V/qD0NWSyDEZsydBNr+uvdT14ix5RGh8cc9Hc9CO0zFlceW3O/xK8ylCgdf5/t2ak sry8kgdONVUvYuaU3V/Zxu2xgJwVip6p8qRoBAzxBBjHG7KIT0g1l5qgQaidbPVN1QYw v9VBeeng2DmejiLBFxD1deJVBBSq5DQ4nVZ1UV1Kc57UeWmPTeh9MngST8j4rNZyNuO9 NeZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=ZJBk+/TbKNTRzgzTok5S7iNfOgVUus5SCx32I7W9hKM=; b=mmlnzUz2lN+grX7GZH9UvlPnuG+HiPG3A2po2kiQTpK6R3ZeQvr2wj26SiN3pebDWi L9aM3U0/Jjl6ObltjY+gBkrB/Ps81tFEnOU3Z5ZvX8C7GpT2LdqmslsXMSRPP37fipAN Qsac8Svh5DiUtF0Uxwv1vEejU7bIPZAEUPMJ+msGbB4Y8Dzc4/hggy9cuu+0j/zfsMb5 wYTDMf9BCw/3sgPeTFdmHMHa4i8XHZDHwnj4sbQqx25gFXnBSEbPk2V/VyEqDmN1gIkI YG/udZXQ3DA0Elc9yyNOR5Kc3XBMiSSDCB4LjDAvpN/FY1qqAhjeGzfmYys6HBmQdGvD pAyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=wtNyNlVW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12-v6si3804278pgb.280.2018.07.21.04.09.04; Sat, 21 Jul 2018 04:09:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=wtNyNlVW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727812AbeGUMAA (ORCPT + 99 others); Sat, 21 Jul 2018 08:00:00 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:41984 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727500AbeGUL77 (ORCPT ); Sat, 21 Jul 2018 07:59:59 -0400 From: Paul Cercueil To: Vinod Koul , Rob Herring , Mark Rutland , Ralf Baechle , Paul Burton , James Hogan , Zubair Lutfullah Kakakhel Cc: Mathieu Malaterre , Daniel Silsby , Paul Cercueil , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org Subject: [PATCH v3 02/18] dmaengine: dma-jz4780: Return error if not probed from DT Date: Sat, 21 Jul 2018 13:06:27 +0200 Message-Id: <20180721110643.19624-3-paul@crapouillou.net> In-Reply-To: <20180721110643.19624-1-paul@crapouillou.net> References: <20180721110643.19624-1-paul@crapouillou.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1532171257; bh=ZJBk+/TbKNTRzgzTok5S7iNfOgVUus5SCx32I7W9hKM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=wtNyNlVWRdYOzYk3ZwcQQ1DDDqWg66TmjWY6iHY7dMvUeJfxo//xAMjCNjnCRNPhjCWyeq/rnLKbZgCx9TvG5g46ECABoZtKV1AmmXKq2GtQtE9leVozmbwZDn8oW5Ok8iw9lgNC403WIBTGd6TUvl5pRBzQqhbIYGRoNwryTpE= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/dma/dma-jz4780.c | 5 +++++ 1 file changed, 5 insertions(+) v2: New patch v3: No change 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; -- 2.11.0