diff mbox series

[v2,08/26] pinctrl: cs42l43: Use fw_devlink_set_device()

Message ID 20250507071315.394857-9-herve.codina@bootlin.com
State New
Headers show
Series lan966x pci device: Add support for SFPs | expand

Commit Message

Herve Codina May 7, 2025, 7:12 a.m. UTC
The code set directly fwnode->dev field.

Use the dedicated fw_devlink_set_device() helper to perform this
operation.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko May 7, 2025, 3:06 p.m. UTC | #1
On Wed, May 07, 2025 at 09:12:50AM +0200, Herve Codina wrote:
> The code set directly fwnode->dev field.
> 
> Use the dedicated fw_devlink_set_device() helper to perform this
> operation.

...

>  		fwnode = fwnode_get_named_child_node(fwnode, "pinctrl");
>  

>  		if (fwnode && !fwnode->dev)

Why do we bother checking the fwnode->dev here?
Just wondering... Hopefully the original author of the code can explain what is
going on here.

> -			fwnode->dev = priv->dev;
> +			fw_devlink_set_device(fwnode, priv->dev);
>  	}
diff mbox series

Patch

diff --git a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
index 628b60ccc2b0..8df85ec5a02e 100644
--- a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
+++ b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
@@ -561,7 +561,7 @@  static int cs42l43_pin_probe(struct platform_device *pdev)
 		fwnode = fwnode_get_named_child_node(fwnode, "pinctrl");
 
 		if (fwnode && !fwnode->dev)
-			fwnode->dev = priv->dev;
+			fw_devlink_set_device(fwnode, priv->dev);
 	}
 
 	priv->gpio_chip.fwnode = fwnode;