summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/device/device_util.c8
-rw-r--r--src/include/device/resource.h40
2 files changed, 22 insertions, 26 deletions
diff --git a/src/device/device_util.c b/src/device/device_util.c
index f05f71df86..a5d1860064 100644
--- a/src/device/device_util.c
+++ b/src/device/device_util.c
@@ -450,7 +450,7 @@ static resource_t align_down(resource_t val, unsigned long gran)
* @param resource The resource whose limit is desired.
* @return The end.
*/
-resource_t resource_end(struct resource *resource)
+resource_t resource_end(const struct resource *resource)
{
resource_t base, end;
@@ -476,7 +476,7 @@ resource_t resource_end(struct resource *resource)
* @param resource The resource whose maximum is desired.
* @return The maximum.
*/
-resource_t resource_max(struct resource *resource)
+resource_t resource_max(const struct resource *resource)
{
resource_t max;
@@ -491,7 +491,7 @@ resource_t resource_max(struct resource *resource)
* @param resource The resource type to decode.
* @return TODO.
*/
-const char *resource_type(struct resource *resource)
+const char *resource_type(const struct resource *resource)
{
static char buffer[RESOURCE_TYPE_MAX];
snprintf(buffer, sizeof(buffer), "%s%s%s%s",
@@ -513,7 +513,7 @@ const char *resource_type(struct resource *resource)
* @param resource The resource that was just stored.
* @param comment TODO
*/
-void report_resource_stored(struct device *dev, struct resource *resource,
+void report_resource_stored(struct device *dev, const struct resource *resource,
const char *comment)
{
char buf[10];
diff --git a/src/include/device/resource.h b/src/include/device/resource.h
index 3a7ccf09e6..098d0b653a 100644
--- a/src/include/device/resource.h
+++ b/src/include/device/resource.h
@@ -63,31 +63,27 @@ struct resource {
/* Generic resource helper functions */
struct device;
struct bus;
-extern void compact_resources(struct device *dev);
-extern struct resource *probe_resource(const struct device *dev,
- unsigned int index);
-extern struct resource *new_resource(struct device *dev, unsigned int index);
-extern struct resource *find_resource(const struct device *dev,
- unsigned int index);
-extern resource_t resource_end(struct resource *resource);
-extern resource_t resource_max(struct resource *resource);
-extern void report_resource_stored(struct device *dev,
- struct resource *resource, const char *comment);
-
-typedef void (*resource_search_t)(void *gp, struct device *dev,
- struct resource *res);
-extern void search_bus_resources(struct bus *bus,
- unsigned long type_mask, unsigned long type,
- resource_search_t search, void *gp);
-
-extern void search_global_resources(
- unsigned long type_mask, unsigned long type,
- resource_search_t search, void *gp);
+void compact_resources(struct device *dev);
+struct resource *probe_resource(const struct device *dev, unsigned int index);
+struct resource *new_resource(struct device *dev, unsigned int index);
+struct resource *find_resource(const struct device *dev, unsigned int index);
+resource_t resource_end(const struct resource *resource);
+resource_t resource_max(const struct resource *resource);
+void report_resource_stored(struct device *dev, const struct resource *resource,
+ const char *comment);
+
+typedef void (*resource_search_t)(void *gp, struct device *dev, struct resource *res);
+
+void search_bus_resources(struct bus *bus, unsigned long type_mask, unsigned long type,
+ resource_search_t search, void *gp);
+
+void search_global_resources(unsigned long type_mask, unsigned long type,
+ resource_search_t search, void *gp);
#define RESOURCE_TYPE_MAX 20
-extern const char *resource_type(struct resource *resource);
+const char *resource_type(const struct resource *resource);
-static inline void *res2mmio(struct resource *res, unsigned long offset,
+static inline void *res2mmio(const struct resource *res, unsigned long offset,
unsigned long mask)
{
return (void *)(uintptr_t)((res->base + offset) & ~mask);