summaryrefslogtreecommitdiff
path: root/arch/arm/xen
diff options
context:
space:
mode:
authorJulien Grall <julien.grall@linaro.org>2015-05-06 17:09:06 +0300
committerDavid Vrabel <david.vrabel@citrix.com>2015-05-28 14:23:10 +0300
commit81e863c3a28e69fd60411bde9f779b0f8ad0212a (patch)
tree02516881b40ace1d990621faf2c3b10d68993c27 /arch/arm/xen
parentba155e2d21f6bf05de86a78dbe5bfd8757604a65 (diff)
downloadlinux-81e863c3a28e69fd60411bde9f779b0f8ad0212a.tar.xz
arm/xen: Correctly check if the event channel interrupt is present
The function irq_of_parse_and_map returns 0 when the IRQ is not found. Futhermore, move the check before notifying the user that we are running on Xen. Signed-off-by: Julien Grall <julien.grall@linaro.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'arch/arm/xen')
-rw-r--r--arch/arm/xen/enlighten.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index 7d0f07020c80..6fbdc8fa4a19 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -51,7 +51,7 @@ EXPORT_SYMBOL_GPL(xen_have_vector_callback);
int xen_platform_pci_unplug = XEN_UNPLUG_ALL;
EXPORT_SYMBOL_GPL(xen_platform_pci_unplug);
-static __read_mostly int xen_events_irq = -1;
+static __read_mostly unsigned int xen_events_irq;
int xen_remap_domain_mfn_array(struct vm_area_struct *vma,
unsigned long addr,
@@ -179,12 +179,14 @@ static int __init xen_guest_init(void)
return 0;
grant_frames = res.start;
xen_events_irq = irq_of_parse_and_map(node, 0);
+ if (!xen_events_irq) {
+ pr_debug("Xen event channel interrupt not found\n");
+ return -ENODEV;
+ }
+
pr_info("Xen %s support found, events_irq=%d gnttab_frame=%pa\n",
version, xen_events_irq, &grant_frames);
- if (xen_events_irq < 0)
- return -ENODEV;
-
xen_domain_type = XEN_HVM_DOMAIN;
xen_setup_features();