pci: allow multiple calls to pcim_enable_device()

There's no reason not to allow multiple calls to pcim_enable_device().
Calls after the first one can simply be noop. All PCI resources will
be released when the initial pcim_enable_device() resource is
released.

This allows more flexibility to managed PCI users.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by Tejun Heo and committed by Jeff Garzik b95d58ea 9f24e82d

+2 -1
+2 -1
drivers/pci/pci.c
··· 823 823 dr = get_pci_dr(pdev); 824 824 if (unlikely(!dr)) 825 825 return -ENOMEM; 826 - WARN_ON(!!dr->enabled); 826 + if (dr->enabled) 827 + return 0; 827 828 828 829 rc = pci_enable_device(pdev); 829 830 if (!rc) {