Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753233AbbETJ32 (ORCPT ); Wed, 20 May 2015 05:29:28 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:62165 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752210AbbETJ3Z (ORCPT ); Wed, 20 May 2015 05:29:25 -0400 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Catalin Marinas , "Rafael J. Wysocki" , linaro-acpi@lists.linaro.org, will.deacon@arm.com, herbert@gondor.apana.org.au, al.stone@linaro.org, linux-acpi@vger.kernel.org, Murali Karicheri , msalter@redhat.com, grant.likely@linaro.org, lenb@kernel.org, thomas.lendacky@amd.com, linux-crypto@vger.kernel.org, Rob Herring , bhelgaas@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, leo.duran@amd.com, hanjun.guo@linaro.org, Suravee Suthikulpanit , David Woodhouse , davem@davemloft.net Subject: Re: [V4 PATCH 3/6] pci: Generic function for setting up PCI device DMA coherency Date: Wed, 20 May 2015 11:27:54 +0200 Message-ID: <2072233.lIH4idDurI@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20150520092415.GA25313@e104818-lin.cambridge.arm.com> References: <1431724994-21601-1-git-send-email-Suravee.Suthikulpanit@amd.com> <3954735.qeaTp8qOcM@vostro.rjw.lan> <20150520092415.GA25313@e104818-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:medL0QDZ0eecHCWKUe+cybILWVUoV+P7wQYKQJ+yBqrXhzJHlW7 gnfyHVdv1ZFRu2n1sK6UwH5PUBX2+GSJZltMPeumUNaKYcr5VkFiQkWQyd4T+WxgiNDvyo8 z5z/smoayM1NlwYjW3sJgbp0CPNjhAfSsYz5Bot83HaCuVFBWF6PuqziYHKUlhHpbpExOxK lP49a92JUorB5qeKrpUeA== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1525 Lines: 41 On Wednesday 20 May 2015 10:24:15 Catalin Marinas wrote: > On Sat, May 16, 2015 at 01:59:00AM +0200, Rafael J. Wysocki wrote: > > On Friday, May 15, 2015 04:23:11 PM Suravee Suthikulpanit wrote: > > > +/** > > > + * pci_dma_configure - Setup DMA configuration > > > + * @pci_dev: ptr to pci_dev struct of the PCI device > > > + * > > > + * Function to update PCI devices's DMA configuration using the same > > > + * info from the OF node or ACPI node of host bridge's parent (if any). > > > + */ > > > +static void pci_dma_configure(struct pci_dev *pci_dev) > > > +{ > > > + struct device *dev = &pci_dev->dev; > > > + struct device *bridge = pci_get_host_bridge_device(pci_dev); > > > + struct device *host = bridge->parent; > > > + struct acpi_device *adev; > > > + > > > + if (!host) > > > + return; > > > + > > > + if (acpi_disabled) { > > > + of_dma_configure(dev, host->of_node); > > > > I'd rather do > > > > if (IS_ENABLED(CONFIG_OF) && host->of_node) { > > of_dma_configure(dev, host->of_node); > > Nitpick: do we need the CONFIG_OF check? If disabled, I don't think > anyone would set host->of_node. > If of_dma_configure() is defined in a file that is built conditionally based on CONFIG_OF, you need it. 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/