Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760576AbbLCPcu (ORCPT ); Thu, 3 Dec 2015 10:32:50 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:51309 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756258AbbLCPcs (ORCPT ); Thu, 3 Dec 2015 10:32:48 -0500 From: Arnd Bergmann To: Peter Ujfalusi Cc: vinod.koul@intel.com, andy.shevchenko@gmail.com, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, nsekhar@ti.com, tony@atomide.com Subject: Re: [PATCH 3/4] dmaengine: core: Introduce new, universal API to request a channel Date: Thu, 03 Dec 2015 16:32:12 +0100 Message-ID: <6922343.04ZpTXZq7O@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1449153192-9082-4-git-send-email-peter.ujfalusi@ti.com> References: <1449153192-9082-1-git-send-email-peter.ujfalusi@ti.com> <1449153192-9082-4-git-send-email-peter.ujfalusi@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:vS5575SKLIRA8LZ+1vUWNwXTYKkkZhjV9c+ZlQiCn82QlqpQ3vG G0948UF2z4X3KFdsAc672k94M4bClr7S2XkaIdicNKCrdjzBo79fa3QO3r6oIapYLTl6d1q 5C4MKcR3gDTB+BdUPwO1JgfUB6skFM2ksifN8KKrj02BbCS+C74bH5ewYHjNFvfUccV62zz Lfy+nvDP0A7kZMqa7kZfA== X-UI-Out-Filterresults: notjunk:1;V01:K0:2OI+WTjKMxA=:nHE6tCGEEcFm+RdqBVFbuL WhlbTdTBCNYHK12R7oQG+U3Gc/BZ+GxISxNJaBM6nlrvcMNBxmsTYRF7+PUdFDqrWF8IH02uH 4BxqmGNMu/9hdqQy2MRlONaEx5Xe1F2S9fJ4kLaXPndlX68jXdvkDIKU63bY+YhwzEj6XC8Xq 2it5AAy92En2CTBIO50U12mK3Hnya0FXkTKz1pafAJFV8SmqYPh40Ostetkgj9/f9saQsHdL2 vfJAurfkzWr6Z/0i/BgvFNVgT1mnFTjWrDcAAxh1bF1VHYe6xdIqkw7b6AUSE+lS/bTDQLP9o dRRfAzNFj66RULJvGGZxxFn24pUXiy3G1XsTPbQkdZe7t5yeLUYqN1q6GyaAQTSLnkzf6t++F aGapH+lU8/dny4hXycUqPpnuyLLmoCBkdRWFvj2jLIG7ItZtuz/QzFrPYWWjreyPlPXmyA0oK bKwC+Ai6OZwFK98yIieJ3RZx1c4DwOGk4gWHDIKMnkVWDzTuoyF5JxNJJSfjow9S8rYLMmKrv LpIM1FtBM6cZSqOwgWbkgFrlpkzxQ4d9yEH9mHNuGmWZXsg9S6o1Ck6M8iFSapda+bNEFQ/80 NqarsiU2GAZsVNCu7odO+Is4lC3Vtus7ZHkVF7RnKAIit8v3MvvAVtudGPBHTbL0a6Zkst1nZ 0y1ld5O2zC4OsvL/nc7DFRveg6n76zzNR+NJGMKER5W7albz9ZXtWVWAb9V/KqPhuSd7VzYtS L14z7kKAVf6s1Qf5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1779 Lines: 46 On Thursday 03 December 2015 16:33:11 Peter Ujfalusi wrote: > + > +/** > + * dma_request_chan - try to allocate an exclusive slave channel > + * @dev: pointer to client device structure > + * @name: slave channel name > + * > + * Returns pointer to appropriate DMA channel on success or an error pointer. > + */ > +struct dma_chan *dma_request_chan(struct device *dev, const char *name) > +{ > + struct dma_device *d, *_d; > + struct dma_chan *chan = NULL; > + > + /* If device-tree is present get slave info from here */ > + if (dev->of_node) > + chan = of_dma_request_slave_channel(dev->of_node, name); > + > + /* If device was enumerated by ACPI get slave info from here */ > + if (has_acpi_companion(dev) && !chan) > + chan = acpi_dma_request_slave_chan_by_name(dev, name); I just noticed that you are creating this as a new interface, rather than changing dma_request_slave_channel_reason() and making the old interface a static inline wrapper. What is the reasoning behind that? I think if we make both interfaces do the same thing, it's easier to do the migration. > + if (chan) { > + /* Valid channel found */ > + if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) > + return chan; > + > + pr_warn("%s: %s DMA request failed, falling back to legacy\n", > + __func__, dev->of_node ? "OF" : "ACPI"); > + } Maybe print the error code as well? Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/