]> git.itanic.dy.fi Git - linux-stable/commitdiff
ata: libahci: Don't read AHCI version twice in the save-config method
authorSerge Semin <Sergey.Semin@baikalelectronics.ru>
Fri, 9 Sep 2022 19:36:12 +0000 (22:36 +0300)
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>
Fri, 16 Sep 2022 16:39:50 +0000 (01:39 +0900)
There is no point in reading the AHCI version all over in the tail of the
ahci_save_initial_config() method. That register is RO and doesn't change
its value even after reset. So just reuse the data, which has already been
read from there earlier in the head of the function.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
drivers/ata/libahci.c

index 000a7072614f53555f6850a0807b5bf5fcc1b2dc..1ffaa5f5f21a213da1be7bc917d33117f01990c8 100644 (file)
@@ -564,7 +564,7 @@ void ahci_save_initial_config(struct device *dev, struct ahci_host_priv *hpriv)
        /* record values to use during operation */
        hpriv->cap = cap;
        hpriv->cap2 = cap2;
-       hpriv->version = readl(mmio + HOST_VERSION);
+       hpriv->version = vers;
        hpriv->port_map = port_map;
 
        if (!hpriv->start_engine)