Commit 387c74e5 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Thierry Reding

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 9b22c17a ("of: Check 'of_node_reused' flag on
of_match_device()") for further details.
Suggested-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 250b4ca0
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment