Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

DMA: Rework txx9dmac suspend_late()/resume_early()

This patch reworks platform driver power management code
for txx9dmac from legacy late/early callbacks to dev_pm_ops.

The callbacks are converted for CONFIG_SUSPEND like this:
suspend_late() -> suspend_noirq()
resume_early() -> resume_noirq()

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

authored by

Magnus Damm and committed by
Rafael J. Wysocki
4aebac2f 4a256b5f

+10 -5
+10 -5
drivers/dma/txx9dmac.c
··· 1291 1291 txx9dmac_off(ddev); 1292 1292 } 1293 1293 1294 - static int txx9dmac_suspend_late(struct platform_device *pdev, 1295 - pm_message_t mesg) 1294 + static int txx9dmac_suspend_noirq(struct device *dev) 1296 1295 { 1296 + struct platform_device *pdev = to_platform_device(dev); 1297 1297 struct txx9dmac_dev *ddev = platform_get_drvdata(pdev); 1298 1298 1299 1299 txx9dmac_off(ddev); 1300 1300 return 0; 1301 1301 } 1302 1302 1303 - static int txx9dmac_resume_early(struct platform_device *pdev) 1303 + static int txx9dmac_resume_noirq(struct device *dev) 1304 1304 { 1305 + struct platform_device *pdev = to_platform_device(dev); 1305 1306 struct txx9dmac_dev *ddev = platform_get_drvdata(pdev); 1306 1307 struct txx9dmac_platform_data *pdata = pdev->dev.platform_data; 1307 1308 u32 mcr; ··· 1315 1314 1316 1315 } 1317 1316 1317 + static struct dev_pm_ops txx9dmac_dev_pm_ops = { 1318 + .suspend_noirq = txx9dmac_suspend_noirq, 1319 + .resume_noirq = txx9dmac_resume_noirq, 1320 + }; 1321 + 1318 1322 static struct platform_driver txx9dmac_chan_driver = { 1319 1323 .remove = __exit_p(txx9dmac_chan_remove), 1320 1324 .driver = { ··· 1330 1324 static struct platform_driver txx9dmac_driver = { 1331 1325 .remove = __exit_p(txx9dmac_remove), 1332 1326 .shutdown = txx9dmac_shutdown, 1333 - .suspend_late = txx9dmac_suspend_late, 1334 - .resume_early = txx9dmac_resume_early, 1335 1327 .driver = { 1336 1328 .name = "txx9dmac", 1329 + .pm = &txx9dmac_dev_pm_ops, 1337 1330 }, 1338 1331 }; 1339 1332