Add pci_enable_device() to aec62xx probe function
before doing any I/O.
Original probe function tries to read from device's
PCI region 4 before calling ide_setup_pci_device().
Since the device is not enabled at this point,
on machines that have no firmware PCI initialization
(e.g. ASUS WL-700gE router), corresponding PCI BAR
is 0 and the following inb() causes a kernel oops.
Signed-off-by: Aleksandar Radovanovic <biblbroks@sezampro.yu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
 {
        struct ide_port_info d;
        u8 idx = id->driver_data;
+       int err;
+
+       err = pci_enable_device(dev);
+       if (err)
+               return err;
 
        d = aec62xx_chipsets[idx];
 
                }
        }
 
-       return ide_setup_pci_device(dev, &d);
+       err = ide_setup_pci_device(dev, &d);
+       if (err)
+               pci_disable_device(dev);
+
+       return err;
 }
 
 static const struct pci_device_id aec62xx_pci_tbl[] = {