Skip to content

Commit 387c74e

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
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 9b22c17 ("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>
1 parent 250b4ca commit 387c74e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pwm/pwm-ntxec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static int ntxec_pwm_probe(struct platform_device *pdev)
140140
struct ntxec_pwm *priv;
141141
struct pwm_chip *chip;
142142

143-
pdev->dev.of_node = pdev->dev.parent->of_node;
143+
device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent);
144144

145145
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
146146
if (!priv)

0 commit comments

Comments
 (0)