Linux SPI subsystem development
 help / color / mirror / Atom feed
* [PATCH v1 1/1] spi: nxp-fspi: Propagate fwnode in ACPI case as well
@ 2025-11-26 20:25 Andy Shevchenko
  2025-11-27  3:41 ` Bough Chen
  2025-11-27 21:21 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2025-11-26 20:25 UTC (permalink / raw)
  To: Mark Brown, Haibo Chen, linux-spi, imx, linux-kernel
  Cc: Han Xu, Yogesh Gaur, Andy Shevchenko

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>
---
 drivers/spi/spi-nxp-fspi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
index b6c79e50d842..50a7e4916a60 100644
--- a/drivers/spi/spi-nxp-fspi.c
+++ b/drivers/spi/spi-nxp-fspi.c
@@ -1287,7 +1287,7 @@ static int nxp_fspi_probe(struct platform_device *pdev)
 {
 	struct spi_controller *ctlr;
 	struct device *dev = &pdev->dev;
-	struct device_node *np = dev->of_node;
+	struct fwnode_handle *fwnode = dev_fwnode(dev);
 	struct resource *res;
 	struct nxp_fspi *f;
 	int ret, irq;
@@ -1309,7 +1309,7 @@ static int nxp_fspi_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, f);
 
 	/* find the resources - configuration register address space */
-	if (is_acpi_node(dev_fwnode(f->dev)))
+	if (is_acpi_node(fwnode))
 		f->iobase = devm_platform_ioremap_resource(pdev, 0);
 	else
 		f->iobase = devm_platform_ioremap_resource_byname(pdev, "fspi_base");
@@ -1317,7 +1317,7 @@ static int nxp_fspi_probe(struct platform_device *pdev)
 		return PTR_ERR(f->iobase);
 
 	/* find the resources - controller memory mapped space */
-	if (is_acpi_node(dev_fwnode(f->dev)))
+	if (is_acpi_node(fwnode))
 		res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 	else
 		res = platform_get_resource_byname(pdev,
@@ -1330,7 +1330,7 @@ static int nxp_fspi_probe(struct platform_device *pdev)
 	f->memmap_phy_size = resource_size(res);
 
 	/* find the clocks */
-	if (dev_of_node(&pdev->dev)) {
+	if (is_of_node(fwnode)) {
 		f->clk_en = devm_clk_get(dev, "fspi_en");
 		if (IS_ERR(f->clk_en))
 			return PTR_ERR(f->clk_en);
@@ -1383,7 +1383,7 @@ static int nxp_fspi_probe(struct platform_device *pdev)
 	else
 		ctlr->mem_caps = &nxp_fspi_mem_caps;
 
-	ctlr->dev.of_node = np;
+	device_set_node(&ctlr->dev, fwnode);
 
 	ret = devm_add_action_or_reset(dev, nxp_fspi_cleanup, f);
 	if (ret)
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH v1 1/1] spi: nxp-fspi: Propagate fwnode in ACPI case as well
  2025-11-26 20:25 [PATCH v1 1/1] spi: nxp-fspi: Propagate fwnode in ACPI case as well Andy Shevchenko
@ 2025-11-27  3:41 ` Bough Chen
  2025-11-27 21:21 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Bough Chen @ 2025-11-27  3:41 UTC (permalink / raw)
  To: Andy Shevchenko, Mark Brown, linux-spi@vger.kernel.org,
	imx@lists.linux.dev, linux-kernel@vger.kernel.org
  Cc: Han Xu, Yogesh Gaur

> -----Original Message-----
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Sent: 2025年11月27日 4:25
> To: Mark Brown <broonie@kernel.org>; Bough Chen <haibo.chen@nxp.com>;
> linux-spi@vger.kernel.org; imx@lists.linux.dev; linux-kernel@vger.kernel.org
> Cc: Han Xu <han.xu@nxp.com>; Yogesh Gaur <yogeshgaur.83@gmail.com>;
> Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Subject: [PATCH v1 1/1] 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.

Reviewed-by: Haibo Chen <haibo.chen@nxp.com>

Thanks
Haibo Chen
> 
> Fixes: 55ab8487e01d ("spi: spi-nxp-fspi: Add ACPI support")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/spi/spi-nxp-fspi.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c index
> b6c79e50d842..50a7e4916a60 100644
> --- a/drivers/spi/spi-nxp-fspi.c
> +++ b/drivers/spi/spi-nxp-fspi.c
> @@ -1287,7 +1287,7 @@ static int nxp_fspi_probe(struct platform_device
> *pdev)  {
>  	struct spi_controller *ctlr;
>  	struct device *dev = &pdev->dev;
> -	struct device_node *np = dev->of_node;
> +	struct fwnode_handle *fwnode = dev_fwnode(dev);
>  	struct resource *res;
>  	struct nxp_fspi *f;
>  	int ret, irq;
> @@ -1309,7 +1309,7 @@ static int nxp_fspi_probe(struct platform_device
> *pdev)
>  	platform_set_drvdata(pdev, f);
> 
>  	/* find the resources - configuration register address space */
> -	if (is_acpi_node(dev_fwnode(f->dev)))
> +	if (is_acpi_node(fwnode))
>  		f->iobase = devm_platform_ioremap_resource(pdev, 0);
>  	else
>  		f->iobase = devm_platform_ioremap_resource_byname(pdev,
> "fspi_base"); @@ -1317,7 +1317,7 @@ static int nxp_fspi_probe(struct
> platform_device *pdev)
>  		return PTR_ERR(f->iobase);
> 
>  	/* find the resources - controller memory mapped space */
> -	if (is_acpi_node(dev_fwnode(f->dev)))
> +	if (is_acpi_node(fwnode))
>  		res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
>  	else
>  		res = platform_get_resource_byname(pdev,
> @@ -1330,7 +1330,7 @@ static int nxp_fspi_probe(struct platform_device
> *pdev)
>  	f->memmap_phy_size = resource_size(res);
> 
>  	/* find the clocks */
> -	if (dev_of_node(&pdev->dev)) {
> +	if (is_of_node(fwnode)) {
>  		f->clk_en = devm_clk_get(dev, "fspi_en");
>  		if (IS_ERR(f->clk_en))
>  			return PTR_ERR(f->clk_en);
> @@ -1383,7 +1383,7 @@ static int nxp_fspi_probe(struct platform_device
> *pdev)
>  	else
>  		ctlr->mem_caps = &nxp_fspi_mem_caps;
> 
> -	ctlr->dev.of_node = np;
> +	device_set_node(&ctlr->dev, fwnode);
> 
>  	ret = devm_add_action_or_reset(dev, nxp_fspi_cleanup, f);
>  	if (ret)
> --
> 2.50.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] spi: nxp-fspi: Propagate fwnode in ACPI case as well
  2025-11-26 20:25 [PATCH v1 1/1] spi: nxp-fspi: Propagate fwnode in ACPI case as well Andy Shevchenko
  2025-11-27  3:41 ` Bough Chen
@ 2025-11-27 21:21 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-11-27 21:21 UTC (permalink / raw)
  To: Haibo Chen, linux-spi, imx, linux-kernel, Andy Shevchenko
  Cc: Han Xu, Yogesh Gaur

On Wed, 26 Nov 2025 21:25:01 +0100, Andy Shevchenko wrote:
> 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.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: nxp-fspi: Propagate fwnode in ACPI case as well
      commit: 40ad64ac25bb736740f895d99a4aebbda9b80991

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-27 21:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-26 20:25 [PATCH v1 1/1] spi: nxp-fspi: Propagate fwnode in ACPI case as well Andy Shevchenko
2025-11-27  3:41 ` Bough Chen
2025-11-27 21:21 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox