Use to_platform_device() instead of open-coding it.
Unified · Split
| @@ -306,8 +306,7 @@ static int stm32_dmamux_probe(struct platform_device *pdev) · 305 unmodified lines | ||
| 306 | 306 | #ifdef CONFIG_PM |
| 307 | 307 | static int stm32_dmamux_runtime_suspend(struct device *dev) |
| 308 | 308 | { |
| 309 | − struct platform_device *pdev = | |
| 310 | − container_of(dev, struct platform_device, dev); | |
| 309 | + struct platform_device *pdev = to_platform_device(dev); | |
| 311 | 310 | struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev); |
| 312 | 311 | |
| 313 | 312 | clk_disable_unprepare(stm32_dmamux->clk); |
| @@ -317,8 +316,7 @@ static int stm32_dmamux_runtime_suspend(struct device *dev) · 3 unmodified lines | ||
| 317 | 316 | |
| 318 | 317 | static int stm32_dmamux_runtime_resume(struct device *dev) |
| 319 | 318 | { |
| 320 | − struct platform_device *pdev = | |
| 321 | − container_of(dev, struct platform_device, dev); | |
| 319 | + struct platform_device *pdev = to_platform_device(dev); | |
| 322 | 320 | struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev); |
| 323 | 321 | int ret; |
| 324 | 322 | |