Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp216304yba; Mon, 20 May 2019 07:33:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8JsiKLb2kPuM6IBzL9pML0h0ozLnnvHVkwANvmgDBUMQEaCO/5GxXSYU7CnM82I1aYBJX X-Received: by 2002:a17:902:2aa6:: with SMTP id j35mr76309177plb.236.1558362810565; Mon, 20 May 2019 07:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558362810; cv=none; d=google.com; s=arc-20160816; b=FFqqonQXzqd3Nh/xKqomKxvU0LHkh5Vry3geC084z+c7qlHgjZlPPQ52W+Mshwiam2 siooCYMWyH5RCKlT0oOeOtI8klcgBMdEYSwVe6tZ3Khy/QV628xAiuQ1RAgicgtypek/ BRJ+aphxRqJTar0shKTm91RVgvBjEj2h42jfnF66o9Yw9+oFE7t3hf8YmsDE10A8LPGB 3lGOnYHeeXHUiup449SOHkWPqKfrDnp386dpFdKzpb56WWo85EVRwG0a0nkthqn5f7Bm R8XOl/P0JRvNO6iKQjIsZb2A0sGjyr5z6GtCk85+XPy0p1KEAFhmwXJLAylXUcZNr94t 5cyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=SIcVyU2wUJ5jnbmBXFPsqnRHsqNC2CkR/vX822PSMOY=; b=Gk4PX3xydy4xBYj+jD8UnNgveDjOJdlzqLXHe2hurXiyK82ne8upOGss2vAk9lHGzg zMl6WYPQ1asyt+GSjMfCCEuRNxSBMCKUhXiyYULtOZr7zI16gJPYINhJ8Nr25IJLzYF5 I0GFWrf+i51VBMngOwbNTAgXXkokoNSpXxxgUOeoyVUbCDSb6dzdIWwuUa5ud9TNeqN7 zO5FSOyZMEm1V+GmUHt3fxr38mQB0lmoD9X1ZXPrqRhrwOUrcWf2SkTqAJUPuWGCkBIz vsrkQk4ZkW7+7sbCFT3MMUQCceUaRS2MHUU2aqGlKhP9iCD+eaqBti/VNipof32pxtfE YlRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QKc8XOBs; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4si17584181pgq.69.2019.05.20.07.33.08; Mon, 20 May 2019 07:33:30 -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=@linaro.org header.s=google header.b=QKc8XOBs; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732953AbfETLc5 (ORCPT + 99 others); Mon, 20 May 2019 07:32:57 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33891 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732946AbfETLc4 (ORCPT ); Mon, 20 May 2019 07:32:56 -0400 Received: by mail-pf1-f196.google.com with SMTP id n19so7106797pfa.1 for ; Mon, 20 May 2019 04:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=SIcVyU2wUJ5jnbmBXFPsqnRHsqNC2CkR/vX822PSMOY=; b=QKc8XOBsWShq6QEmKaBcAza24sj5L89yQgva5BBJBD15azjrDgyggyl2Y6xH7l9m0+ qnbIVd8x46sGrGKbAFeOh9JcMuN8/8jHVUwKDDhLh5QIfnAQQVJcZo5GHolCqHVWUW1O HOOJE3BxF5szua4H8FJtxAzbduLES4VIQYRkDnjzWncNLnDgwlxQgwChnpNXpKFovDT6 4ZR45hFmVZ3QeHbNTfQ+mYMUwLMzZPT9tDEZSw9OLO4EKIVIp293+huklSqG+P9pT0sK JqjJIHo8V9bygr+sN87cZAnBBnSAcX+nCot+RqBM0luM5W3PidNFeReMZjG/yi3x4T1B DwzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=SIcVyU2wUJ5jnbmBXFPsqnRHsqNC2CkR/vX822PSMOY=; b=dGB5mFZAPBgwFPVFDcFzYYwukSpN173oOL2565dHLBz0b4mvloST1AufrRvVVmrP+r oqhNb7d3MvhDD72Sr9ZaMZoOEET1rPZnEJY+v0Q0hbJNEqBlUvsW6n8RHsKu/196PCb2 Nclcs2wSb390Hauu3x7zJr0Kv/+OPMwqmmg8hZU+xQdstCNigupWd6DrMLXiBpBXw4TW 42lWL4ImzLMOgHg9SITqjbxOy2XyBrjlK8Ee2CRXLNWnffeQ2hv4TsPorV6tLU2V+qF0 bUi3Gcph0JZPjfkFpBoivU29529wfvZjN571RwpJgoJUl6mSnBGSMyrOQ3yG1P/V6MCD aokg== X-Gm-Message-State: APjAAAUQ43Z4RfCH3iyqmtw98ojfuyvAQyyF8VOFczTehAriKfyOJ7nD Qio7hpih5vWKZuKQ2Zj+uDMvmWmi7ubsvg== X-Received: by 2002:a63:184:: with SMTP id 126mr48415643pgb.420.1558351976125; Mon, 20 May 2019 04:32:56 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id z124sm21310020pfz.116.2019.05.20.04.32.51 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 04:32:55 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Cc: thierry.reding@gmail.com, jonathanh@nvidia.com, linux-tegra@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, wsa+renesas@sang-engineering.com, jroedel@suse.de, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 5/8] dmaengine: mmp_tdma: Let the core do the device node validation Date: Mon, 20 May 2019 19:32:18 +0800 Message-Id: <5600ce71701aac33035d78bf038d97ca331bf18b.1558351667.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let the DMA engine core do the device node validation instead of drivers. Signed-off-by: Baolin Wang --- drivers/dma/mmp_tdma.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c index 0c56faa0..e76858b 100644 --- a/drivers/dma/mmp_tdma.c +++ b/drivers/dma/mmp_tdma.c @@ -586,18 +586,12 @@ static int mmp_tdma_chan_init(struct mmp_tdma_device *tdev, } struct mmp_tdma_filter_param { - struct device_node *of_node; unsigned int chan_id; }; static bool mmp_tdma_filter_fn(struct dma_chan *chan, void *fn_param) { struct mmp_tdma_filter_param *param = fn_param; - struct mmp_tdma_chan *tdmac = to_mmp_tdma_chan(chan); - struct dma_device *pdma_device = tdmac->chan.device; - - if (pdma_device->dev->of_node != param->of_node) - return false; if (chan->chan_id != param->chan_id) return false; @@ -615,13 +609,13 @@ static struct dma_chan *mmp_tdma_xlate(struct of_phandle_args *dma_spec, if (dma_spec->args_count != 1) return NULL; - param.of_node = ofdma->of_node; param.chan_id = dma_spec->args[0]; if (param.chan_id >= TDMA_CHANNEL_NUM) return NULL; - return dma_request_channel(mask, mmp_tdma_filter_fn, ¶m); + return __dma_request_channel(&mask, mmp_tdma_filter_fn, ¶m, + ofdma->of_node); } static const struct of_device_id mmp_tdma_dt_ids[] = { -- 1.7.9.5