mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 04:38:03 +00:00
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 9b22c17a3c
("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>
This commit is contained in:
parent
250b4ca0c9
commit
387c74e5f9
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user