From patchwork Mon May 20 11:32:16 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: 164592 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp167670ili; Mon, 20 May 2019 04:32:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUeP+BKItUohhngpWG8X0nrjZn/oraab3svMFFdtizB4Yfc06PZMc1eG9Phfb6gwfHp+rA X-Received: by 2002:a65:52c8:: with SMTP id z8mr6054397pgp.10.1558351968178; Mon, 20 May 2019 04:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558351968; cv=none; d=google.com; s=arc-20160816; b=t9f1i7A29AZEk1Zid2WLcW7Kf0uJCtkslEHgDxo+vVJutRK7jQod+EjM/XdZSIOiE+ r/viZksr+o0WnGiNtq6SCyejaonWR+FG9W4w7nGfNHlQCn5qHk3yWnt4ZQRYHltmoNr9 remu//Xt+MXDb+CVL1TmktgFEJp1ix/hA3qqGd4ZOoEhX8ZsDP0Ns6LVhswcI/1goDP+ wdxyg9gfXaA111uTdD2kwbT+R7L2JSOt7jlact2R+zveeduWvvYD8NyEZz8q+8JUhF9A /qzDJwIVh6Mx+xvD4ppEgLdM2KV+9B+ZjXyTFU+qvoCexZnRdP1fo1Jv7Pk2+cATarRX Iy1A== 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=Rhx5bIGIXYyTwXNSrFhH6sXCwPoowbOq8I8g6rhgfcM=; b=gfTvl0x1Oa+94i22Srk5+VDGjmP8q5FTv4QAcJyniuQZZoD4HUNWu81A0bee5dnSeO urmZdpZGfYU390Z5NOlDLhAgiMin29sx4WYeJjnI1FvDuhKU3aN1wHVaQu3O73pe00+E +tQ6LjJKRVE2p+PKjINhWzBDzUoK5oYSZi30rFR+a+VrhFyQy3Y+RuDtK06+QvL4gcT2 JXN5ZCjskYaZmnVmZpX5jEUMZFXuRimQoO8hzFodYY5K1tc/4gGnLhqnBRU86I4E6tlw lBXMP/8fwnJBuu5nwtuksA9KWbnRSxkf7OVmqMjX/OpfgegpHC+eAyPBc8JGwLmseaWG Pzag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="u/TmKJQV"; 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 e192si17128583pgc.222.2019.05.20.04.32.47; Mon, 20 May 2019 04:32:48 -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="u/TmKJQV"; 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 S1732921AbfETLcr (ORCPT + 3 others); Mon, 20 May 2019 07:32:47 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:42533 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732918AbfETLcr (ORCPT ); Mon, 20 May 2019 07:32:47 -0400 Received: by mail-pl1-f195.google.com with SMTP id x15so6592177pln.9 for ; Mon, 20 May 2019 04:32:47 -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=Rhx5bIGIXYyTwXNSrFhH6sXCwPoowbOq8I8g6rhgfcM=; b=u/TmKJQVbWXU1jY6nvSgyqY9QzIEzS6idFSTXXT7qz9wsgNBI/s4V17hUgh4Rv7R2Y cwuuJfl56c+TBCEGqsc5RRIu34NSt4lHOx8UibOcyvnhXey8lHP7056ZxtHY0B4NseoG 6152HD/5j7w4ftbZ4++CLib5eBofL1XNbn5oS8Osd8NYxVsBI8Ft9hZDT1zAZ/NwACnM BkDXCqfsjhvdPmSFeCmpfO3FxtOu2mbVJWnOjskv6Npuj/95BixXJKam34owM1QCU0dF hZkQDeWU7Y0zRyI7nbkB4upO4egh0ZnC/sBYA0i4TH21JKW6sXLUUZFUxv9bWc9DnUq2 NdBA== 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=Rhx5bIGIXYyTwXNSrFhH6sXCwPoowbOq8I8g6rhgfcM=; b=lIGi8g1UDjVWAxg5SlNkSlhnseko5zxIr6KDLoM0V8nIRxfsCGH8ETWbNpJveSn5y6 AhcXb5EV7c0AWpqIGlkISdr9QTAytuFFPnOsPUx2IS+6ftaGbvb904tr1OimmPkJF4ve dmwNXiSSap2b7AOcjsWU4etv1SKQkMI1UDjOVI3OeFRFgP0OFDrtskhgg1WVpNbtqdIK XJZDyrv9Jd9GS3sm3rpzWC/XXMbF6Wp22ZSreM9GYBsmyj7jbkJcmG+SJn0Pgp/HoTzu gGzwbj6r4j5iPTL4qGmz/7KsO3iGuYwkaWh2n8fZWoBXn48i1qqnncwGQsLaApNn5lnw SklA== X-Gm-Message-State: APjAAAV3XwiMQFd4wRIofsPvj9RPZyaktd2eRMMLpChQyyFQpxQO96fO 5Szvq+87qG9x7pDXqsJarLarOw== X-Received: by 2002:a17:902:8ec4:: with SMTP id x4mr65112742plo.249.1558351966882; Mon, 20 May 2019 04:32:46 -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.42 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 04:32:46 -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 3/8] dmaengine: imx-sdma: Let the core do the device node validation Date: Mon, 20 May 2019 19:32:16 +0800 Message-Id: <77c1171088844b62a50977817103c2cf01fd75ae.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/imx-sdma.c | 9 ++------- include/linux/platform_data/dma-imx.h | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) -- 1.7.9.5 diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 99d9f43..ca296f0 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1934,16 +1934,11 @@ static int sdma_init(struct sdma_engine *sdma) static bool sdma_filter_fn(struct dma_chan *chan, void *fn_param) { struct sdma_channel *sdmac = to_sdma_chan(chan); - struct sdma_engine *sdma = sdmac->sdma; struct imx_dma_data *data = fn_param; if (!imx_dma_is_general_purpose(chan)) return false; - /* return false if it's not the right device */ - if (sdma->dev->of_node != data->of_node) - return false; - sdmac->data = *data; chan->private = &sdmac->data; @@ -1971,9 +1966,9 @@ static struct dma_chan *sdma_xlate(struct of_phandle_args *dma_spec, * be set to sdmac->event_id1. */ data.dma_request2 = 0; - data.of_node = ofdma->of_node; - return dma_request_channel(mask, sdma_filter_fn, &data); + return __dma_request_channel(&mask, sdma_filter_fn, &data, + ofdma->of_node); } static int sdma_probe(struct platform_device *pdev) diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h index 9daea8d..7d964e7 100644 --- a/include/linux/platform_data/dma-imx.h +++ b/include/linux/platform_data/dma-imx.h @@ -55,7 +55,6 @@ struct imx_dma_data { int dma_request2; /* secondary DMA request line */ enum sdma_peripheral_type peripheral_type; int priority; - struct device_node *of_node; }; static inline int imx_dma_is_ipu(struct dma_chan *chan)