diff options
author | Vaibhav Gupta <vaibhavgupta40@gmail.com> | 2020-08-20 00:26:54 +0530 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2020-09-08 13:33:20 +0200 |
commit | a91df118990083a47ab644f8ef63f17eeae4b1ad (patch) | |
tree | 6df0af35a4498ebd53198d08b9b3aa210b59f4e1 /net/9p | |
parent | fb6e2db899e7483a5fb47a94cf03bd6d03e8bbe6 (diff) | |
download | linux-a91df118990083a47ab644f8ef63f17eeae4b1ad.tar.gz linux-a91df118990083a47ab644f8ef63f17eeae4b1ad.tar.bz2 linux-a91df118990083a47ab644f8ef63f17eeae4b1ad.zip |
fbdev: arkfb: use generic power management
Drivers should do only device-specific jobs. But in general, drivers using
legacy PCI PM framework for .suspend()/.resume() have to manage many PCI
PM-related tasks themselves which can be done by PCI Core itself. This
brings extra load on the driver and it directly calls PCI helper functions
to handle them.
Switch to the new generic framework by updating function signatures and
define a "struct dev_pm_ops" variable to bind PM callbacks. Also, remove
unnecessary calls to the PCI Helper functions along with the legacy
.suspend & .resume bindings.
The ark_pci_suspend() is not designed to function in the case of Freeze.
Thus, the code checked for "if (state.event == PM_EVENT_FREEZE....)". This
is because, in the legacy framework, this callback was invoked even in the
event of Freeze. Hence, added the load of unnecessary function-call.
The goal can be achieved by binding the callback with only ".suspend" and
".poweroff" in the "ark_pci_pm_ops" const variable. This also avoids the
step of checking "state.event == PM_EVENT_FREEZE" every time the callback
is invoked.
Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Bjorn Helgaas <bjorn@helgaas.com>
Cc: Vaibhav Gupta <vaibhav.varodek@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Andres Salomon <dilinger@queued.net>
CC: Antonino Daplas <adaplas@gmail.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200819185654.151170-13-vaibhavgupta40@gmail.com
Diffstat (limited to 'net/9p')
0 files changed, 0 insertions, 0 deletions