platform/chrome: cros_ec: fix compilation warning
authorTzung-Bi Shih <tzungbi@kernel.org>
Tue, 3 Oct 2023 08:04:53 +0000 (08:04 +0000)
committerTzung-Bi Shih <tzungbi@kernel.org>
Thu, 5 Oct 2023 10:09:38 +0000 (18:09 +0800)
When including cros_ec.h solely, the compiler emits the following
warning:
> 'struct cros_ec_device' declared inside parameter list
  will not be visible outside of this definition or declaration

Fix it by forward declaration.

Reviewed-by: Guenter Roeck <groeck@chromium.org>
Link: https://lore.kernel.org/r/20231003080453.4011301-1-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
drivers/platform/chrome/cros_ec.h

index bbca0096868ac99904cee132d8bf239ff3cbaf19..2b25742360307a719d2d4526c0c164549c1e059b 100644 (file)
@@ -10,6 +10,8 @@
 
 #include <linux/interrupt.h>
 
+struct cros_ec_device;
+
 int cros_ec_register(struct cros_ec_device *ec_dev);
 void cros_ec_unregister(struct cros_ec_device *ec_dev);