From patchwork Fri Oct 28 16:00:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugeniy Paltsev X-Patchwork-Id: 688494 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t57nw4wNkz9sQw for ; Sat, 29 Oct 2016 03:03:00 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c09cR-0002y9-0w; Fri, 28 Oct 2016 16:02:59 +0000 Received: from smtprelay4.synopsys.com ([198.182.47.9] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c09cF-0002ey-32 for linux-snps-arc@lists.infradead.org; Fri, 28 Oct 2016 16:02:50 +0000 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 6BCE824E0638; Fri, 28 Oct 2016 09:02:26 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 543DAA1B; Fri, 28 Oct 2016 09:02:26 -0700 (PDT) Received: from paltsev-8460-lab.internal.synopsys.com (paltsev-8460-lab.internal.synopsys.com [10.121.14.113]) by mailhost.synopsys.com (Postfix) with ESMTP id 5E5609E1; Fri, 28 Oct 2016 09:02:24 -0700 (PDT) From: Eugeniy Paltsev To: dmaengine@vger.kernel.org Subject: [PATCH v3 2/3] dmaengine: DW DMAC: convert to unified device property API Date: Fri, 28 Oct 2016 19:00:01 +0300 Message-Id: <1477670402-23943-3-git-send-email-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1477670402-23943-1-git-send-email-Eugeniy.Paltsev@synopsys.com> References: <1477670402-23943-1-git-send-email-Eugeniy.Paltsev@synopsys.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161028_090247_413825_A7357420 X-CRM114-Status: UNSURE ( 7.93 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -3.3 (---) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-3.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [198.182.47.9 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.47.9 listed in list.dnswl.org] -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-snps-arc@lists.infradead.org, vinod.koul@intel.com, vireshk@kernel.org, linux-kernel@vger.kernel.org, dan.j.williams@intel.com, andriy.shevchenko@linux.intel.com, Eugeniy Paltsev MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Convert device tree properties reading to unified device property API, update properties names as ordered by DT policy. Signed-off-by: Eugeniy Paltsev --- drivers/dma/dw/platform.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c index 77cde375..85368bc 100644 --- a/drivers/dma/dw/platform.c +++ b/drivers/dma/dw/platform.c @@ -98,56 +98,51 @@ static inline void dw_dma_acpi_controller_register(struct dw_dma *dw) {} #ifdef CONFIG_OF static struct dw_dma_platform_data * -dw_dma_parse_dt(struct platform_device *pdev) +dw_dma_parse_properties(struct device *dev) { - struct device_node *np = pdev->dev.of_node; struct dw_dma_platform_data *pdata; u32 tmp, arr[DW_DMA_MAX_NR_MASTERS]; u32 nr_masters; u32 nr_channels; - if (!np) { - dev_err(&pdev->dev, "Missing DT data\n"); - return NULL; - } - - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); if (!pdata) return NULL; pdata->only_quirks_used = true; - if (of_property_read_bool(np, "is_private")) + if (device_property_read_bool(dev, "is-private")) pdata->is_private = true; - if (of_property_read_bool(np, "is-memcpy")) + if (device_property_read_bool(dev, "is-memcpy")) pdata->is_memcpy = true; - if (of_property_read_u32(np, "dma-masters", &nr_masters)) + if (device_property_read_u32(dev, "dma-masters", &nr_masters)) return pdata; if (nr_masters < 1 || nr_masters > DW_DMA_MAX_NR_MASTERS) return pdata; pdata->nr_masters = nr_masters; - if (of_property_read_u32(np, "dma-channels", &nr_channels)) + if (device_property_read_u32(dev, "dma-channels", &nr_channels)) return pdata; pdata->nr_channels = nr_channels; - if (of_property_read_bool(np, "is-nollp")) + if (device_property_read_bool(dev, "is-nollp")) pdata->is_nollp = true; - if (!of_property_read_u32(np, "chan_allocation_order", &tmp)) + if (!device_property_read_u32(dev, "chan-allocation-order", &tmp)) pdata->chan_allocation_order = (unsigned char)tmp; - if (!of_property_read_u32(np, "chan_priority", &tmp)) + if (!device_property_read_u32(dev, "chan-priority", &tmp)) pdata->chan_priority = tmp; - if (!of_property_read_u32(np, "block_size", &tmp)) + if (!device_property_read_u32(dev, "block-size", &tmp)) pdata->block_size = tmp; - if (!of_property_read_u32_array(np, "data-width", arr, nr_masters)) { + if (!device_property_read_u32_array(dev, "data-width", arr, + nr_masters)) { for (tmp = 0; tmp < nr_masters; tmp++) pdata->data_width[tmp] = arr[tmp]; } @@ -158,7 +153,7 @@ dw_dma_parse_dt(struct platform_device *pdev) } #else static inline struct dw_dma_platform_data * -dw_dma_parse_dt(struct platform_device *pdev) +dw_dma_parse_properties(struct device *dev) { return NULL; } @@ -191,7 +186,7 @@ static int dw_probe(struct platform_device *pdev) pdata = dev_get_platdata(dev); if (!pdata) - pdata = dw_dma_parse_dt(pdev); + pdata = dw_dma_parse_properties(dev); chip->dev = dev; chip->pdata = pdata;