#ifdef CONFIG_PM
 static int stm32_dmamux_runtime_suspend(struct device *dev)
 {
-       struct platform_device *pdev =
-               container_of(dev, struct platform_device, dev);
+       struct platform_device *pdev = to_platform_device(dev);
        struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev);
 
        clk_disable_unprepare(stm32_dmamux->clk);
 
 static int stm32_dmamux_runtime_resume(struct device *dev)
 {
-       struct platform_device *pdev =
-               container_of(dev, struct platform_device, dev);
+       struct platform_device *pdev = to_platform_device(dev);
        struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev);
        int ret;