Prechádzať zdrojové kódy

pwm: tiecap: Set driver data before runtime PM enable

Runtime PM callbacks can be run right after runtime PM is enabled, so
make sure to set the driver data before that. This is unlikely to ever
happen with the current driver, but it doesn't hurt to follow best
practices anyway.

Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Thierry Reding 8 rokov pred
rodič
commit
23f373e6fe
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      drivers/pwm/pwm-tiecap.c

+ 1 - 1
drivers/pwm/pwm-tiecap.c

@@ -254,9 +254,9 @@ static int ecap_pwm_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	platform_set_drvdata(pdev, pc);
 	pm_runtime_enable(&pdev->dev);
 
-	platform_set_drvdata(pdev, pc);
 	return 0;
 }