Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b01dcdd8 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Rob Herring
Browse files

drivers/of: Make of_io_request_and_map() "name" argument optional



These days of_address_to_resource() puts a reasonable name
in the resource struct, thus make the "name" argument an
optional override.

Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent b7394b7f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -846,7 +846,7 @@ EXPORT_SYMBOL(of_iomap);
 *			   for a given device_node
 * @device:	the device whose io range will be mapped
 * @index:	index of the io range
 * @name:	name of the resource
 * @name:	name "override" for the memory region request or NULL
 *
 * Returns a pointer to the requested and mapped memory or an ERR_PTR() encoded
 * error code on failure. Usage example:
@@ -864,6 +864,8 @@ void __iomem *of_io_request_and_map(struct device_node *np, int index,
	if (of_address_to_resource(np, index, &res))
		return IOMEM_ERR_PTR(-EINVAL);

	if (!name)
		name = res.name;
	if (!request_mem_region(res.start, resource_size(&res), name))
		return IOMEM_ERR_PTR(-EBUSY);