提交 b95d58ea 编写于 作者: T Tejun Heo 提交者: Jeff Garzik

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: NTejun Heo <htejun@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 9f24e82d
......@@ -823,7 +823,8 @@ int pcim_enable_device(struct pci_dev *pdev)
dr = get_pci_dr(pdev);
if (unlikely(!dr))
return -ENOMEM;
WARN_ON(!!dr->enabled);
if (dr->enabled)
return 0;
rc = pci_enable_device(pdev);
if (!rc) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册