Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: nxp-fspi: Propagate fwnode in ACPI case as well

Propagate fwnode of the ACPI device to the SPI controller Linux device.
Currently only OF case propagates fwnode to the controller.

While at it, replace several calls to dev_fwnode() with a single one
cached in a local variable, and unify checks for fwnode type by using
is_*_node() APIs.

Fixes: 55ab8487e01d ("spi: spi-nxp-fspi: Add ACPI support")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Link: https://patch.msgid.link/20251126202501.2319679-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Andy Shevchenko and committed by
Mark Brown
40ad64ac 3dcf44ab

+5 -5
+5 -5
drivers/spi/spi-nxp-fspi.c
··· 1287 1287 { 1288 1288 struct spi_controller *ctlr; 1289 1289 struct device *dev = &pdev->dev; 1290 - struct device_node *np = dev->of_node; 1290 + struct fwnode_handle *fwnode = dev_fwnode(dev); 1291 1291 struct resource *res; 1292 1292 struct nxp_fspi *f; 1293 1293 int ret, irq; ··· 1309 1309 platform_set_drvdata(pdev, f); 1310 1310 1311 1311 /* find the resources - configuration register address space */ 1312 - if (is_acpi_node(dev_fwnode(f->dev))) 1312 + if (is_acpi_node(fwnode)) 1313 1313 f->iobase = devm_platform_ioremap_resource(pdev, 0); 1314 1314 else 1315 1315 f->iobase = devm_platform_ioremap_resource_byname(pdev, "fspi_base"); ··· 1317 1317 return PTR_ERR(f->iobase); 1318 1318 1319 1319 /* find the resources - controller memory mapped space */ 1320 - if (is_acpi_node(dev_fwnode(f->dev))) 1320 + if (is_acpi_node(fwnode)) 1321 1321 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 1322 1322 else 1323 1323 res = platform_get_resource_byname(pdev, ··· 1330 1330 f->memmap_phy_size = resource_size(res); 1331 1331 1332 1332 /* find the clocks */ 1333 - if (dev_of_node(&pdev->dev)) { 1333 + if (is_of_node(fwnode)) { 1334 1334 f->clk_en = devm_clk_get(dev, "fspi_en"); 1335 1335 if (IS_ERR(f->clk_en)) 1336 1336 return PTR_ERR(f->clk_en); ··· 1383 1383 else 1384 1384 ctlr->mem_caps = &nxp_fspi_mem_caps; 1385 1385 1386 - ctlr->dev.of_node = np; 1386 + device_set_node(&ctlr->dev, fwnode); 1387 1387 1388 1388 ret = devm_add_action_or_reset(dev, nxp_fspi_cleanup, f); 1389 1389 if (ret)