summaryrefslogtreecommitdiffstats
path: root/drivers/pwm
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-07-18 19:53:10 +0200
committerThierry Reding <thierry.reding@gmail.com>2023-07-28 09:39:02 +0200
commit387c74e5f91d8e6f0c6e49fddd8b0e53118e5def (patch)
treeb00826900936360c5ca79e1d6bff68ca8353a4bd /drivers/pwm
parentpwm: ntxec: Drop a write-only variable from driver data (diff)
downloadlinux-387c74e5f91d8e6f0c6e49fddd8b0e53118e5def.tar.xz
linux-387c74e5f91d8e6f0c6e49fddd8b0e53118e5def.zip
pwm: ntxec: Use device_set_of_node_from_dev()
Compared to overwriting pdev->dev.of_node directly, this takes care of reference counting. It also prevents that the parent device matches this driver. See commit 9b22c17a3cc5 ("of: Check 'of_node_reused' flag on of_match_device()") for further details. Suggested-by: Rob Herring <robh@kernel.org> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r--drivers/pwm/pwm-ntxec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-ntxec.c b/drivers/pwm/pwm-ntxec.c
index baf912c5bf0f..7514ea384ec5 100644
--- a/drivers/pwm/pwm-ntxec.c
+++ b/drivers/pwm/pwm-ntxec.c
@@ -140,7 +140,7 @@ static int ntxec_pwm_probe(struct platform_device *pdev)
struct ntxec_pwm *priv;
struct pwm_chip *chip;
- pdev->dev.of_node = pdev->dev.parent->of_node;
+ device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent);
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)