Merge tag 'md-fixes-20230914' of https://git.kernel.org/pub/scm/linux/kernel/git...
[platform/kernel/linux-starfive.git] / drivers / pwm / pwm-ntxec.c
index ab63b08..7514ea3 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/types.h>
 
 struct ntxec_pwm {
-       struct device *dev;
        struct ntxec *ec;
        struct pwm_chip chip;
 };
@@ -141,14 +140,13 @@ 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)
                return -ENOMEM;
 
        priv->ec = ec;
-       priv->dev = &pdev->dev;
 
        chip = &priv->chip;
        chip->dev = &pdev->dev;