Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/34613 )
Change subject: device: Constify `dev` argument to (probe|find)_resource() ......................................................................
device: Constify `dev` argument to (probe|find)_resource()
Change-Id: I7abca61db61d2f2df149ca601631c45d8c4f342e Signed-off-by: Nico Huber nico.huber@secunet.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/34613 Reviewed-by: Aamir Bohra aamir.bohra@intel.com Reviewed-by: Paul Menzel paulepanter@users.sourceforge.net Reviewed-by: Furquan Shaikh furquan@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/device/device_util.c M src/include/device/resource.h 2 files changed, 6 insertions(+), 4 deletions(-)
Approvals: build bot (Jenkins): Verified Paul Menzel: Looks good to me, but someone else must approve Furquan Shaikh: Looks good to me, approved Aamir Bohra: Looks good to me, approved
diff --git a/src/device/device_util.c b/src/device/device_util.c index 3f503b5..38303126b 100644 --- a/src/device/device_util.c +++ b/src/device/device_util.c @@ -331,7 +331,7 @@ * @param index The index of the resource on the device. * @return The resource, if it already exists. */ -struct resource *probe_resource(struct device *dev, unsigned index) +struct resource *probe_resource(const struct device *dev, unsigned index) { struct resource *res;
@@ -401,7 +401,7 @@ * @param index The index of the resource on the device. * return TODO. */ -struct resource *find_resource(struct device *dev, unsigned index) +struct resource *find_resource(const struct device *dev, unsigned index) { struct resource *resource;
diff --git a/src/include/device/resource.h b/src/include/device/resource.h index eefaf96..1d04e9a 100644 --- a/src/include/device/resource.h +++ b/src/include/device/resource.h @@ -62,9 +62,11 @@ struct device; struct bus; extern void compact_resources(struct device *dev); -extern struct resource *probe_resource(struct device *dev, unsigned int index); +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(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,