From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sinan Kaya Subject: Re: [PATCH] dma-mapping: move dma configuration to bus infrastructure Date: Mon, 12 Mar 2018 12:44:22 -0400 Message-ID: <6a76df69-8c6c-52a6-0afd-fd0b8d2ff703@codeaurora.org> References: <1520868292-2479-1-git-send-email-nipun.gupta@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1520868292-2479-1-git-send-email-nipun.gupta-3arQi8VN3Tc@public.gmane.org> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Nipun Gupta , hch-jcswGhMUV9g@public.gmane.org, robin.murphy-5wv7dgnIgG8@public.gmane.org, linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org Cc: rafael.j.wysocki-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, msuchanek-l3A5Bk7waGM@public.gmane.org List-Id: iommu@lists.linux-foundation.org On 3/12/2018 11:24 AM, Nipun Gupta wrote: > + if (dma_dev->of_node) { > + ret = of_dma_configure(dev, dma_dev->of_node); > + } else if (has_acpi_companion(dma_dev)) { > + attr = acpi_get_dma_attr(to_acpi_device_node(dma_dev->fwnode)); > + if (attr != DEV_DMA_NOT_SUPPORTED) > + ret = acpi_dma_configure(dev, attr); > + } > + > + pci_put_host_bridge_device(bridge); > + > + return ret; > +} > + > +void pci_dma_deconfigure(struct device *dev) > +{ > + of_dma_deconfigure(dev); > + acpi_dma_deconfigure(dev); > +} Isn't this one or the other one but not both? Something like: if (dev->of_node) of_dma_deconfigure(dev); else acpi_dma_deconfigure(dev); should work. -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.