microblaze: warn if of_iomap() failed
authorNicholas Mc Guire <hofrat@osadl.org>
Mon, 9 Jul 2018 08:42:44 +0000 (10:42 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 11 Jul 2018 08:06:46 +0000 (10:06 +0200)
of_iomap() can return NULL. The function is void thus error propagation
is not possible but at least a WARN_ON() seems warranted here as a silent
failure might lead to a hard to understand system state.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/microblaze/pci/xilinx_pci.c

index 14c7da5fd039d6266b71210739f398389a814bb5..b800909ddccf712b95fb8cca3a72a45ea632c78a 100644 (file)
@@ -157,6 +157,7 @@ void __init xilinx_pci_init(void)
 
        /* Set the max bus number to 255, and bus/subbus no's to 0 */
        pci_reg = of_iomap(pci_node, 0);
+       WARN_ON(!pci_reg);
        out_be32(pci_reg + XPLB_PCI_BUS, 0x000000ff);
        iounmap(pci_reg);