Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp181455yba; Mon, 20 May 2019 07:02:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6f6omxUmBIFK9lirVlr5YbfD3PBrEJcFJi0q/TYyytSe/ROh3gqsJiegzeKwPiODSsZY/ X-Received: by 2002:a63:6647:: with SMTP id a68mr59235457pgc.292.1558360958969; Mon, 20 May 2019 07:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558360958; cv=none; d=google.com; s=arc-20160816; b=DnfLTT4ntVkpJlRdy6N7eCKIxDXrbWb2LRt25aDjmx8kYuVmkvrImnYPJHkMrnTa1p ybVm2VYds/MaY3DQXGE8vfUcuCpm4PK+brVarJLn3YC9gO1LVhZRK0jgPreIAZ2VKpGR 3OZ2jcsNIZpEXtdbu5MmUTnnH1nr8ah7djn9kHUu3+FACyyGSiKyO59erPMu1yDCCY5o b1pZc/vZkBEmyFS0a8fiu26R0aZY84E864Pom8BESaBJ8WJlOcalmnHFo0O2ahaJYQW3 MYMGC7dFc1/l2tZRqPndywbSDE557+V7P8s4ifvO7ndbtHMyFUNu9EXCYZcayMXU21aA r0yA== 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=uT6u8R+1Cpy6vic0RdG6VJoLUHTHImfiw+NTWytx/20lmEcdUElmCqGhQnCAr7d+gB RrFzuNDFhtbSV8fBoeet9tIileMpCkUYQc8U6VSUcOzAZWSV51KcgbjsiXs2/UrTZcJD OnT6IXlx0Q8bETtSk/fVTC7X+LWtnkghGyMJKuv9fS71VgmkQMxNYonRKRS0RrBQ0rXP o/EAJ4Dl63iY0s7fqhOkZ9xCHbXxDngkoVinDp2VYZyrRUjDkw8jBEUl8VNdwDPxm8Y+ SgWLJL5rnvUHe3L6y5U/rQMa4bdDDpwqj+RR2aXXyzZX+aLxIbeZYW6Zd+z7y1qlG+D6 AHog== 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 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 j8si18596802plb.352.2019.05.20.07.02.23; Mon, 20 May 2019 07:02:38 -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="u/TmKJQV"; 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 S1732927AbfETLcr (ORCPT + 99 others); Mon, 20 May 2019 07:32:47 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:43925 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732919AbfETLcr (ORCPT ); Mon, 20 May 2019 07:32:47 -0400 Received: by mail-pl1-f196.google.com with SMTP id gn7so2434643plb.10 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=V05DQUV23LXLTu2kSTAXWBsjqsZSn/GILIknqZ9lmewa/mgr9Q5AKiTfxvLMokMc+B xhOm88Agl0p44VvJWxXf673Mq9EkYwmzP0M4SsKU5KNzwZ0q7223diUT14yfeAPKaNO8 mnpYWVWgDp/E+JuHU4PRjr0oJikB83J1f1k1EZHWQsu4ZvtzXcrNMohPiy6l9s2LZZv5 Y309elUrhdYYykFnUiu0+smqjUsJagjYDsWYj31YRIAX9WT3ors/f9HJW9fdpgJuCO5M MNQuTEAAR3fNGnaXwkZWY55T76sSu36GwcgV2Ovu0mV4I+xE51KvDakLa2+JKnq35ARG iteA== X-Gm-Message-State: APjAAAX7u7MsbfEgwRPdpYAS4MkpPZtkpZ1jbwMt83SysvWnCk0OA/wf aWuU5Q7PvGYOdSdHKlQJfi4s36TgxD6Phw== 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: 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/imx-sdma.c | 9 ++------- include/linux/platform_data/dma-imx.h | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) 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) -- 1.7.9.5