[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2673003.mTFjFBS7Ob@wuerfel>
Date: Wed, 20 May 2015 14:02:40 +0200
From: Arnd Bergmann <arnd@...db.de>
To: linaro-acpi@...ts.linaro.org
Cc: Suravee Suthikulanit <suravee.suthikulpanit@....com>,
Catalin Marinas <catalin.marinas@....com>,
herbert@...dor.apana.org.au, netdev@...r.kernel.org,
will.deacon@....com, linux-kernel@...r.kernel.org,
Rob Herring <robh+dt@...nel.org>, davem@...emloft.net,
linux-acpi@...r.kernel.org, Murali Karicheri <m-karicheri2@...com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>, lenb@...nel.org,
bhelgaas@...gle.com, David Woodhouse <dwmw2@...radead.org>,
linux-arm-kernel@...ts.infradead.org, linux-crypto@...r.kernel.org
Subject: Re: [Linaro-acpi] [V4 PATCH 3/6] pci: Generic function for setting up PCI device DMA coherency
On Wednesday 20 May 2015 07:00:25 Suravee Suthikulanit wrote:
> It seems that there are several places that have similar check. Would it
> be good to convert this into a macro? Something like:
>
> #define OF_NODE_ENABLED(dev) (IS_ENABLED(CONFIG_OF) && dev->of_node)
>
> Thanks all for the review feedback.
>
Better make that an inline function that returns the node:
struct device_node *dev_of_node(struct device *)
{
if (IS_ENABLED(CONFIG_OF))
return dev->of_node;
return NULL;
}
Arnd
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists