Skip to content

Commit 40ad64a

Browse files
andy-shevbroonie
authored andcommitted
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: 55ab848 ("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>
1 parent 3dcf44a commit 40ad64a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/spi/spi-nxp-fspi.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,7 @@ static int nxp_fspi_probe(struct platform_device *pdev)
12871287
{
12881288
struct spi_controller *ctlr;
12891289
struct device *dev = &pdev->dev;
1290-
struct device_node *np = dev->of_node;
1290+
struct fwnode_handle *fwnode = dev_fwnode(dev);
12911291
struct resource *res;
12921292
struct nxp_fspi *f;
12931293
int ret, irq;
@@ -1309,15 +1309,15 @@ static int nxp_fspi_probe(struct platform_device *pdev)
13091309
platform_set_drvdata(pdev, f);
13101310

13111311
/* find the resources - configuration register address space */
1312-
if (is_acpi_node(dev_fwnode(f->dev)))
1312+
if (is_acpi_node(fwnode))
13131313
f->iobase = devm_platform_ioremap_resource(pdev, 0);
13141314
else
13151315
f->iobase = devm_platform_ioremap_resource_byname(pdev, "fspi_base");
13161316
if (IS_ERR(f->iobase))
13171317
return PTR_ERR(f->iobase);
13181318

13191319
/* find the resources - controller memory mapped space */
1320-
if (is_acpi_node(dev_fwnode(f->dev)))
1320+
if (is_acpi_node(fwnode))
13211321
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
13221322
else
13231323
res = platform_get_resource_byname(pdev,
@@ -1330,7 +1330,7 @@ static int nxp_fspi_probe(struct platform_device *pdev)
13301330
f->memmap_phy_size = resource_size(res);
13311331

13321332
/* find the clocks */
1333-
if (dev_of_node(&pdev->dev)) {
1333+
if (is_of_node(fwnode)) {
13341334
f->clk_en = devm_clk_get(dev, "fspi_en");
13351335
if (IS_ERR(f->clk_en))
13361336
return PTR_ERR(f->clk_en);
@@ -1383,7 +1383,7 @@ static int nxp_fspi_probe(struct platform_device *pdev)
13831383
else
13841384
ctlr->mem_caps = &nxp_fspi_mem_caps;
13851385

1386-
ctlr->dev.of_node = np;
1386+
device_set_node(&ctlr->dev, fwnode);
13871387

13881388
ret = devm_add_action_or_reset(dev, nxp_fspi_cleanup, f);
13891389
if (ret)

0 commit comments

Comments
 (0)