libata: PCI device should be powered up before being accessed
[firefly-linux-kernel-4.4.55.git] / drivers / ata / pata_sis.c
index 3b5be77e861c77139eab0cc15f4f9fd26c3954db..abda90f5124753f880d339e6fb35c7d1b2a0d978 100644 (file)
@@ -55,6 +55,7 @@ static const struct sis_laptop sis_laptop[] = {
        /* devid, subvendor, subdev */
        { 0x5513, 0x1043, 0x1107 },     /* ASUS A6K */
        { 0x5513, 0x1734, 0x105F },     /* FSC Amilo A1630 */
+       { 0x5513, 0x1071, 0x8640 },     /* EasyNote K5305 */
        /* end marker */
        { 0, }
 };
@@ -344,7 +345,7 @@ static void sis_old_set_dmamode (struct ata_port *ap, struct ata_device *adev)
 
        if (adev->dma_mode < XFER_UDMA_0) {
                /* bits 3-0 hold recovery timing bits 8-10 active timing and
-                  the higer bits are dependant on the device */
+                  the higher bits are dependant on the device */
                timing &= ~0x870F;
                timing |= mwdma_bits[speed];
        } else {
@@ -384,7 +385,7 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct ata_device *adev)
 
        if (adev->dma_mode < XFER_UDMA_0) {
                /* bits 3-0 hold recovery timing bits 8-10 active timing and
-                  the higer bits are dependant on the device, bit 15 udma */
+                  the higher bits are dependant on the device, bit 15 udma */
                timing &= ~0x870F;
                timing |= mwdma_bits[speed];
        } else {
@@ -861,6 +862,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        struct pci_dev *host = NULL;
        struct sis_chipset *chipset = NULL;
        struct sis_chipset *sets;
+       int rc;
 
        static struct sis_chipset sis_chipsets[] = {
 
@@ -913,8 +915,11 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
                dev_printk(KERN_DEBUG, &pdev->dev,
                           "version " DRV_VERSION "\n");
 
-       /* We have to find the bridge first */
+       rc = pcim_enable_device(pdev);
+       if (rc)
+               return rc;
 
+       /* We have to find the bridge first */
        for (sets = &sis_chipsets[0]; sets->device; sets++) {
                host = pci_get_device(PCI_VENDOR_ID_SI, sets->device, NULL);
                if (host != NULL) {