From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755973AbbLAKHo (ORCPT ); Tue, 1 Dec 2015 05:07:44 -0500 Received: from mail-yk0-f180.google.com ([209.85.160.180]:34828 "EHLO mail-yk0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752205AbbLAKHl (ORCPT ); Tue, 1 Dec 2015 05:07:41 -0500 MIME-Version: 1.0 In-Reply-To: <565D6EDA.4070002@ti.com> References: <1448891145-10766-1-git-send-email-peter.ujfalusi@ti.com> <1448891145-10766-4-git-send-email-peter.ujfalusi@ti.com> <565D6EDA.4070002@ti.com> Date: Tue, 1 Dec 2015 12:07:40 +0200 Message-ID: Subject: Re: [RFC v02 03/15] dmaengine: core: Introduce new, universal API to request a channel From: Andy Shevchenko To: Peter Ujfalusi Cc: Vinod Koul , Arnd Bergmann , "linux-kernel@vger.kernel.org" , dmaengine , Linux OMAP Mailing List , linux-arm Mailing List , "linux-mmc@vger.kernel.org" , Sekhar Nori , linux-spi Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 1, 2015 at 11:56 AM, Peter Ujfalusi wrote: > On 11/30/2015 04:51 PM, Andy Shevchenko wrote: >>> +struct dma_chan *dma_request_chan(struct device *dev, const char *name) >>> +{ >>> + struct dma_device *device, *_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 (ACPI_HANDLE(dev) && !chan) >> >> The preferable way is to use >> has_acpi_companion() instead of ACPI_HANDLE(). > > I have done this part based on the dma_request_slave_channel_reason(). Understood, though that function was implemented before has_acpi_companion() has been introduced. > Will switch to use the has_acpi_companion() for the next RFC. Good. -- With Best Regards, Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 From: andy.shevchenko@gmail.com (Andy Shevchenko) Date: Tue, 1 Dec 2015 12:07:40 +0200 Subject: [RFC v02 03/15] dmaengine: core: Introduce new, universal API to request a channel In-Reply-To: <565D6EDA.4070002@ti.com> References: <1448891145-10766-1-git-send-email-peter.ujfalusi@ti.com> <1448891145-10766-4-git-send-email-peter.ujfalusi@ti.com> <565D6EDA.4070002@ti.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, Dec 1, 2015 at 11:56 AM, Peter Ujfalusi wrote: > On 11/30/2015 04:51 PM, Andy Shevchenko wrote: >>> +struct dma_chan *dma_request_chan(struct device *dev, const char *name) >>> +{ >>> + struct dma_device *device, *_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 (ACPI_HANDLE(dev) && !chan) >> >> The preferable way is to use >> has_acpi_companion() instead of ACPI_HANDLE(). > > I have done this part based on the dma_request_slave_channel_reason(). Understood, though that function was implemented before has_acpi_companion() has been introduced. > Will switch to use the has_acpi_companion() for the next RFC. Good. -- With Best Regards, Andy Shevchenko