Skip to content

Commit b8e3603

Browse files
robherringgregkh
authored andcommitted
fsi: master-ast-cf: Use of_reserved_mem_region_to_resource for "memory-region"
Use the newly added of_reserved_mem_region_to_resource() function to handle "memory-region" properties. Signed-off-by: "Rob Herring (Arm)" <robh@kernel.org> Reviewed-by: Eddie James <eajames@linux.ibm.com> Link: https://lore.kernel.org/r/20250703183439.2073555-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 966c5cd commit b8e3603

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

drivers/fsi/fsi-master-ast-cf.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
#include <linux/irqflags.h>
1414
#include <linux/module.h>
1515
#include <linux/of.h>
16+
#include <linux/of_reserved_mem.h>
1617
#include <linux/platform_device.h>
1718
#include <linux/slab.h>
1819
#include <linux/regmap.h>
1920
#include <linux/firmware.h>
2021
#include <linux/gpio/aspeed.h>
2122
#include <linux/mfd/syscon.h>
22-
#include <linux/of_address.h>
2323
#include <linux/genalloc.h>
2424

2525
#include "fsi-master.h"
@@ -1285,14 +1285,7 @@ static int fsi_master_acf_probe(struct platform_device *pdev)
12851285
master->gpio_mux = gpio;
12861286

12871287
/* Grab the reserved memory region (use DMA API instead ?) */
1288-
np = of_parse_phandle(mnode, "memory-region", 0);
1289-
if (!np) {
1290-
dev_err(&pdev->dev, "Didn't find reserved memory\n");
1291-
rc = -EINVAL;
1292-
goto err_free;
1293-
}
1294-
rc = of_address_to_resource(np, 0, &res);
1295-
of_node_put(np);
1288+
rc = of_reserved_mem_region_to_resource(mnode, 0, &res);
12961289
if (rc) {
12971290
dev_err(&pdev->dev, "Couldn't address to resource for reserved memory\n");
12981291
rc = -ENOMEM;

0 commit comments

Comments
 (0)