should all .resume and .suspend be conditional on CONFIG_PM?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  i'm currently digging into the structure of PCI drivers and i'm
looking at net/ne2k-pci.c as a simple example, where i can see:

=====

#ifdef CONFIG_PM
static int ne2k_pci_suspend (struct pci_dev *pdev, pm_message_t state)
{
... snip ...
}

static int ne2k_pci_resume (struct pci_dev *pdev)
{
... snip ...
}

#endif /* CONFIG_PM */


static struct pci_driver ne2k_driver = {
        .name           = DRV_NAME,
        .probe          = ne2k_pci_init_one,
        .remove         = __devexit_p(ne2k_pci_remove_one),
        .id_table       = ne2k_pci_tbl,
#ifdef CONFIG_PM
        .suspend        = ne2k_pci_suspend,
        .resume         = ne2k_pci_resume,
#endif /* CONFIG_PM */

=====

  the question -- is it reasonable to assume that *all* PCI drivers
should conditionally protect their suspend/resume code with a test of
CONFIG_PM similar to the above?  that is, are there any circumstances
where you would define a PCI driver with suspend and resume capability
when CONFIG_PM is *not* configured?  since i'm sure i saw an example
of that the other day, i just can't remember where.

rday

-- 

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

        Top-notch, inexpensive online Linux/OSS/kernel courses
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux