• Vaibhav Gupta's avatar
    sun/sungem: use generic power management · d4ce70b3
    Vaibhav Gupta authored
    With legacy PM, drivers themselves were responsible for managing the
    device's power states and takes care of register states. And they use PCI
    helper functions to do it.
    
    After upgrading to the generic structure, PCI core will take care of
    required tasks and drivers should do only device-specific operations.
    
    In this driver:
    gem_suspend() calls gem_do_stop() which in turn invokes
    pci_disable_device(). As the PCI helper function is not called at the
    end/start of the function body, breaking the function in two parts
    may change its behavior.
    
    The only other function invoking gem_do_stop() is gem_close(). Hence,
    gem_close() and gem_suspend() can do the required end steps on their own.
    
    The same case is with gem_resume(). Both gem_resume() and gem_open()
    invoke gem_do_start(). Again, make the caller functions do the required
    steps on their own.
    
    Compile-tested only.
    Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    d4ce70b3
sungem.c 76.2 KB