aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ipa
diff options
context:
space:
mode:
authorRob Herring (Arm) <robh@kernel.org>2025-07-03 13:34:57 -0500
committerJakub Kicinski <kuba@kernel.org>2025-07-08 08:29:46 -0700
commite27dba1951cec8385e20d6700990d819c0de4ba0 (patch)
treed7b9dc9a0001bb5fc096ffbb122df73bb5da5030 /drivers/net/ipa
parentgve: global: fix "for a while" typo (diff)
downloadlinux-e27dba1951cec8385e20d6700990d819c0de4ba0.tar.gz
linux-e27dba1951cec8385e20d6700990d819c0de4ba0.zip
net: Use of_reserved_mem_region_to_resource{_byname}() for "memory-region"
Use the newly added of_reserved_mem_region_to_resource{_byname}() functions to handle "memory-region" properties. The error handling is a bit different for mtk_wed_mcu_load_firmware(). A failed match of the "memory-region-names" would skip the entry, but then other errors in the lookup and retrieval of the address would not skip the entry. However, that distinction is not really important. Either the region is available and usable or it is not. So now, errors from of_reserved_mem_region_to_resource() are ignored so the region is simply skipped. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20250703183459.2074381-1-robh@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ipa')
-rw-r--r--drivers/net/ipa/ipa_main.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c
index f25f6e2cf58c..25500c5a6928 100644
--- a/drivers/net/ipa/ipa_main.c
+++ b/drivers/net/ipa/ipa_main.c
@@ -9,7 +9,7 @@
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_address.h>
+#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/types.h>
@@ -586,7 +586,6 @@ static void ipa_deconfig(struct ipa *ipa)
static int ipa_firmware_load(struct device *dev)
{
const struct firmware *fw;
- struct device_node *node;
struct resource res;
phys_addr_t phys;
const char *path;
@@ -594,14 +593,7 @@ static int ipa_firmware_load(struct device *dev)
void *virt;
int ret;
- node = of_parse_phandle(dev->of_node, "memory-region", 0);
- if (!node) {
- dev_err(dev, "DT error getting \"memory-region\" property\n");
- return -EINVAL;
- }
-
- ret = of_address_to_resource(node, 0, &res);
- of_node_put(node);
+ ret = of_reserved_mem_region_to_resource(dev->of_node, 0, &res);
if (ret) {
dev_err(dev, "error %d getting \"memory-region\" resource\n",
ret);