of: Make of_fwnode_handle() safer
authorSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 24 May 2017 14:53:54 +0000 (17:53 +0300)
committerRob Herring <robh@kernel.org>
Thu, 1 Jun 2017 13:50:47 +0000 (08:50 -0500)
commitdebd3a3b27c76c65a7d032b6f01710e6a6d555ab
treebd872b01ad8b51c6a69eaf18e2bac10375c9c20c
parent1df09bc66f9bc146732628f8426787f35ab1804b
of: Make of_fwnode_handle() safer

On the expense of a little bit more complexity in the of_fwnode_handle()
macro, make the macro result in NULL in case its argument is NULL while
still referencing it only once.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Rob Herring <robh@kernel.org>
include/linux/of.h