From 5c642e8bdba87382fe49160b0a315e6ce7c8c89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kruszewski?= Date: Tue, 14 Mar 2017 21:39:04 +0100 Subject: [PATCH] device: Fix DEVICE_DECLARE macro to be usable inside drivers source code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix an issue where declaring a device in order to use DEVICE_GET macro resulted in error: 'static declaration follows non-static declaration'. Change-Id: I3e851e4d34e905601672e60ded50ed888c4d2a3c Signed-off-by: MichaƂ Kruszewski --- include/device.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/device.h b/include/device.h index 8c6bf1cdaf3..514eeb06c74 100644 --- a/include/device.h +++ b/include/device.h @@ -268,11 +268,11 @@ extern struct device_pm_ops device_pm_ops_nop; /** @def DEVICE_DECLARE * - * @brief Declare a device object + * @brief Declare a static device object * * This macro can be used at the top-level to declare a device, such * that DEVICE_GET() may be used before the full declaration in - * DEVICE_INIT(), or reference the device in another C file. + * DEVICE_INIT(). * * This is often useful when configuring interrupts statically in a * device's init or per-instance config function, as the init function @@ -281,7 +281,7 @@ extern struct device_pm_ops device_pm_ops_nop; * * @param name Device name */ -#define DEVICE_DECLARE(name) extern struct device DEVICE_NAME_GET(name) +#define DEVICE_DECLARE(name) static struct device DEVICE_NAME_GET(name) struct device;