diff options
author | Furquan Shaikh <furquan@google.com> | 2020-04-24 21:31:35 -0700 |
---|---|---|
committer | Furquan Shaikh <furquan@google.com> | 2020-04-28 19:39:37 +0000 |
commit | 5b5c233e909b67482908b0f32452c7cbcd6fae0e (patch) | |
tree | 5d678955ac72d3f790ffb9eb6ca030316daf9126 /src | |
parent | d14d03a6a8518ac3b4e24e8e35d60ce5e9d726aa (diff) |
device: Constify struct device * parameter to dev_name
dev_name() does not need to modify the device structure. Hence, this
change makes the struct device * parameter to dev_name() as const.
Change-Id: I6a94394385e45fd76f68218bf57914bddd2e2121
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/40703
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/device/device_util.c | 2 | ||||
-rw-r--r-- | src/include/device/device.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/device/device_util.c b/src/device/device_util.c index 25e95cfa67..aa2f06a332 100644 --- a/src/device/device_util.c +++ b/src/device/device_util.c @@ -225,7 +225,7 @@ const char *dev_path(const struct device *dev) return buffer; } -const char *dev_name(struct device *dev) +const char *dev_name(const struct device *dev) { if (dev->name) return dev->name; diff --git a/src/include/device/device.h b/src/include/device/device.h index 295415aa7f..40aa2d0419 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -182,7 +182,7 @@ void dev_finalize_chips(void); int reset_bus(struct bus *bus); void scan_bridges(struct bus *bus); void assign_resources(struct bus *bus); -const char *dev_name(struct device *dev); +const char *dev_name(const struct device *dev); const char *dev_path(const struct device *dev); u32 dev_path_encode(const struct device *dev); const char *bus_path(struct bus *bus); |