aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/pci.c
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@novell.com>2011-08-17 04:32:32 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-08-26 12:10:18 -0400
commit12e13ac84ca70e6641a4750e9317aa2d2c1f6f50 (patch)
treef9de32ed820ec931de951dc101b73c5f0fc11ba5 /drivers/xen/pci.c
parent61ca79831ce52c23b3a130f3c2351751e00e0ac9 (diff)
xen/pci: make bus notifier handler return sane values
Notifier functions are expected to return NOTIFY_* codes, not -E... ones. In particular, since the respective hypercalls failing is not fatal to the operation of the Dom0 kernel, it must be avoided to return negative values here as those would make it appear as if NOTIFY_STOP_MASK wa set, suppressing further notification calls to other interested parties (which is also why we don't want to use notifier_from_errno() here). While at it, also notify the user of a failed hypercall. Signed-off-by: Jan Beulich <jbeulich@novell.com> [v1: Added dev_err and the disable MSI/MSI-X call] [v2: Removed the disable MSI/MSI-X call] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen/pci.c')
-rw-r--r--drivers/xen/pci.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c
index cef4bafc07dc..02c402b1ed80 100644
--- a/drivers/xen/pci.c
+++ b/drivers/xen/pci.c
@@ -96,13 +96,16 @@ static int xen_pci_notifier(struct notifier_block *nb,
96 r = xen_remove_device(dev); 96 r = xen_remove_device(dev);
97 break; 97 break;
98 default: 98 default:
99 break; 99 return NOTIFY_DONE;
100 } 100 }
101 101 if (r)
102 return r; 102 dev_err(dev, "Failed to %s - passthrough or MSI/MSI-X might fail!\n",
103 action == BUS_NOTIFY_ADD_DEVICE ? "add" :
104 (action == BUS_NOTIFY_DEL_DEVICE ? "delete" : "?"));
105 return NOTIFY_OK;
103} 106}
104 107
105struct notifier_block device_nb = { 108static struct notifier_block device_nb = {
106 .notifier_call = xen_pci_notifier, 109 .notifier_call = xen_pci_notifier,
107}; 110};
108 111