Re: [Linaro-acpi] [V4 PATCH 3/6] pci: Generic function for setting up PCI device DMA coherency

From
Arnd Bergmann <arnd@arndb.de>
Date
2015-05-20 12:03:52
Also in
linux-acpi, linux-arm-kernel, linux-crypto, lkml
Reply to
Suravee Suthikulanit, 2015-05-20
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
Thread (32 messages) 32 messages, 8 authors, last reply 2015-05-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help