Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial
[linux-3.10.git] / drivers / serial / 8250_pci.c
index 950560ff9b46488307686aaa9b561948ae76808d..a1d322f8a16c8fdfc388c49e6833241e96302700 100644 (file)
@@ -594,8 +594,8 @@ pci_default_setup(struct serial_private *priv, struct pciserial_board *board,
        else
                offset += idx * board->uart_offset;
 
-       maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) /
-               (8 << board->reg_shift);
+       maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) >>
+               (board->reg_shift + 3);
 
        if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
                return 1;