summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarek Vasut <[email protected]>2026-06-12 03:59:06 +0200
committerTom Rini <[email protected]>2026-06-29 15:29:44 -0600
commit4a0990218aa9185c2ccd7986dc1ad14b24aaaa9d (patch)
tree2146da5a61d4117675891f2b52d8ed87632111b5 /include
parenta51f24ac31fbb910afc66824e8299a417b297536 (diff)
cros_ec: Convert dm_cros_ec_get_ops into an inline function and constify dm_cros_ec_ops
Convert dm_cros_ec_get_ops into an inline function to improve compiler code coverage, and constify struct dm_cros_ec_ops in a few places. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/cros_ec.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/cros_ec.h b/include/cros_ec.h
index 4ef34815e35..6e5153ceb6a 100644
--- a/include/cros_ec.h
+++ b/include/cros_ec.h
@@ -12,6 +12,7 @@
#include <ec_commands.h>
#include <cros_ec_message.h>
#include <asm/gpio.h>
+#include <dm/device.h>
#include <dm/of_extra.h>
/*
@@ -316,8 +317,10 @@ struct dm_cros_ec_ops {
int (*get_switches)(struct udevice *dev);
};
-#define dm_cros_ec_get_ops(dev) \
- ((struct dm_cros_ec_ops *)(dev)->driver->ops)
+static inline const struct dm_cros_ec_ops *dm_cros_ec_get_ops(struct udevice *dev)
+{
+ return (const struct dm_cros_ec_ops *)(dev->driver->ops);
+}
int cros_ec_register(struct udevice *dev);