From patchwork Mon May 20 11:32:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 164594 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp167846ili; Mon, 20 May 2019 04:32:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkLIaddgir/GtfBQzxnQvjP7DtcLuBuw/ARsGb/xfHyLdRjntzRbygDdc5mjwvkMzyDE76 X-Received: by 2002:a63:a84c:: with SMTP id i12mr76480215pgp.115.1558351977383; Mon, 20 May 2019 04:32:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558351977; cv=none; d=google.com; s=arc-20160816; b=qNafJtQkzPR00VvBdWgMSIwoLA3KNAwr0V3rswxGnBzlo2eR9YasMjiBwvm6JLmFmP IUiQNYZLQReWwsLrqyITcE/Fd77I8sBskCCz1gA3f/2nMENjVcztpPWKrs0fvfarTpRf Qx43lkaULx6aZwqS7YfVuuKnUKYyB2yUq92wbbRfKZWGLxA3amKoLeZTB5ZFaMSUWsp4 je1emcMbPTIituiDs8n++gVVpef1NMo/kbnVjk36I6F+nAkPFgAdbcMKokeF1bqgXRDg oqXtahMgT2pPgzuqAEjwVzoO43boCbcmTMVfLqoeBIvVccdVA+dnY/kO/LtQWBwwHDe0 TPiw== 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=uY4aki7iebiv/nLvXO8jD2tiqPh3jMZDbWMobAlp+qnwH7i3iSfYrP6RJjwxTjT2kL QOVdw0C/JjoTQQxgLASomEJhkPbHHbREebeh7vAuH2o1pL3//OKzSJtuoaaf6xLyAAAD iq/k3LC6QIeyenI2ka9OdyEoMslek09pomEcHslNxNt3skvkJp0eJ6MM0FACtxQhImww RoF8yIAzC7lMW8O6/naD/PK6yb1up6IBqVGzMOXcTmLUGgCzaz+3jTZJJ+AKAcLcZsPq FoiKSYL1+tDjwKYoX50G0X66c3zySzqmUNqeZ1RR2BRH9Aw/yaTckjfWzRe7ETA/VAt5 9PKA== 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 dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-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 c21si17531156pgh.321.2019.05.20.04.32.57; Mon, 20 May 2019 04:32:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dmaengine-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 dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-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 S1732947AbfETLc4 (ORCPT + 3 others); Mon, 20 May 2019 07:32:56 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:41974 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732945AbfETLc4 (ORCPT ); Mon, 20 May 2019 07:32:56 -0400 Received: by mail-pf1-f195.google.com with SMTP id q17so7079427pfq.8 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=G8a0IOjiMgK1wHp/QUkcDxOdajSKV4vPsi3nJXzl07fdRjPoLb8wQXA/v2piaj+OPd R+JqzUN/TGjTammEJ/s20iXsRWLVDdPc6lW5Ga4HkhnhxlLAY+nVilYBhs114McPatjs R7A3PtHy9FpATpH8H1lyWuHcNTFVK2xTuZ/uAIBnMMsFCOfzYsukw7Ec5CwDMXIUEGz+ 8YYpl+txVq8lTQPOmwh7vk9Y0AoWXgTYMzpiQM4df9tk2oRb69wSOEMOYWGBk8Ea/1r5 Z20BziFZoJH+VImHC5QxyULmmqf3foZA3VMTzkMH6Md8hE27Wpw+pjSVYg3tgdofRtvF /jVQ== X-Gm-Message-State: APjAAAXOzzGfbBMWgqs/xQxXyYbaqwMHgM6djvEHcxw440UPganlURFG j5lVpYOK6aLr0TBAYuZp8Bq7RA== 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: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@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(-) -- 1.7.9.5 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[] = {