libata: fix hw_sata_spd_limit initialization
[deliverable/linux.git] / drivers / ata / libata-core.c
index e7937166a8ba5ad837f67e785d071cf5c2dc65c4..bf8d3b8c171df34b48fd4acc43bb6c9c7b30e16c 100644 (file)
@@ -6317,7 +6317,8 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
                /* init sata_spd_limit to the current value */
                if (sata_scr_read(ap, SCR_CONTROL, &scontrol) == 0) {
                        int spd = (scontrol >> 4) & 0xf;
-                       ap->hw_sata_spd_limit &= (1 << spd) - 1;
+                       if (spd)
+                               ap->hw_sata_spd_limit &= (1 << spd) - 1;
                }
                ap->sata_spd_limit = ap->hw_sata_spd_limit;
 
This page took 0.026396 seconds and 5 git commands to generate.