From 45f2933b81ccb6a08261df8504f4470da30697f8 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 10:40:32 +0000 Subject: of: address: Provide descriptions for 'of_address_to_resource's params Fixes the following W=1 kernel build warning(s): drivers/of/address.c:868: warning: Function parameter or member 'dev' not described in 'of_address_to_resource' drivers/of/address.c:868: warning: Function parameter or member 'index' not described in 'of_address_to_resource' drivers/of/address.c:868: warning: Function parameter or member 'r' not described in 'of_address_to_resource' Cc: Rob Herring Cc: Frank Rowand Cc: devicetree@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20210318104036.3175910-7-lee.jones@linaro.org --- drivers/of/address.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/of/address.c') diff --git a/drivers/of/address.c b/drivers/of/address.c index 73ddf2540f3f..7de41abe7153 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -857,6 +857,9 @@ static int __of_address_to_resource(struct device_node *dev, /** * of_address_to_resource - Translate device tree address and return as resource + * @dev: Caller's Device Node + * @index: Index into the array + * @r: Pointer to resource array * * Note that if your address is a PIO address, the conversion will fail if * the physical address can't be internally converted to an IO token with -- cgit v1.2.3 From 9d57e61bf72336e13e4cd3c31e93ab26266296a8 Mon Sep 17 00:00:00 2001 From: Leonardo Bras Date: Thu, 15 Apr 2021 15:00:51 -0300 Subject: of/pci: Add IORESOURCE_MEM_64 to resource flags for 64-bit memory addresses Many other resource flag parsers already add this flag when the input has bits 24 & 25 set, so update this one to do the same. Some devices (like virtio-net) have more than one memory resource (like MMIO32 and MMIO64) and without this flag it would be needed to verify the address range to know which one is which. Signed-off-by: Leonardo Bras Link: https://lore.kernel.org/r/20210415180050.373791-1-leobras.c@gmail.com Signed-off-by: Rob Herring --- drivers/of/address.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/of/address.c') diff --git a/drivers/of/address.c b/drivers/of/address.c index 7de41abe7153..d3d10d45b9fa 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -116,9 +116,12 @@ static unsigned int of_bus_pci_get_flags(const __be32 *addr) flags |= IORESOURCE_IO; break; case 0x02: /* 32 bits */ - case 0x03: /* 64 bits */ flags |= IORESOURCE_MEM; break; + + case 0x03: /* 64 bits */ + flags |= IORESOURCE_MEM | IORESOURCE_MEM_64; + break; } if (w & 0x40000000) flags |= IORESOURCE_PREFETCH; -- cgit v1.2.3