diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2020-05-21 20:05:43 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-22 09:38:13 +0200 |
commit | 3d1e7aa80d1c0e7ce8313f21c1e9c14a12d3ba48 (patch) | |
tree | 41036f3d6a12f55a2b15ac150fbb4df0f5f5ae17 /drivers/misc/cardreader/rts5261.c | |
parent | misc: rtsx: Use ASPM_MASK_NEG instead of hard-coded value (diff) | |
download | linux-3d1e7aa80d1c0e7ce8313f21c1e9c14a12d3ba48.tar.xz linux-3d1e7aa80d1c0e7ce8313f21c1e9c14a12d3ba48.zip |
misc: rtsx: Use pcie_capability_clear_and_set_word() for PCI_EXP_LNKCTL
Instead of using the driver-specific rtsx_pci_update_cfg_byte() to update
the PCIe Link Control Register, use pcie_capability_clear_and_set_word()
like the rest of the kernel does. This makes it easier to maintain ASPM
across the PCI core and drivers.
Remove the now-unused rtsx_pci_update_cfg_byte() and ASPM_MASK_NEG
definitions.
No functional change intended.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20200521180545.1159896-5-helgaas@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/cardreader/rts5261.c')
-rw-r--r-- | drivers/misc/cardreader/rts5261.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/misc/cardreader/rts5261.c b/drivers/misc/cardreader/rts5261.c index a41e805e4c94..195822ec858e 100644 --- a/drivers/misc/cardreader/rts5261.c +++ b/drivers/misc/cardreader/rts5261.c @@ -518,28 +518,22 @@ static int rts5261_extra_init_hw(struct rtsx_pcr *pcr) static void rts5261_enable_aspm(struct rtsx_pcr *pcr, bool enable) { - u8 val = 0; - if (pcr->aspm_enabled == enable) return; - val = pcr->aspm_en; - rtsx_pci_update_cfg_byte(pcr, pcr->pcie_cap + PCI_EXP_LNKCTL, - ASPM_MASK_NEG, val); + pcie_capability_clear_and_set_word(pcr->pci, PCI_EXP_LNKCTL, + PCI_EXP_LNKCTL_ASPMC, pcr->aspm_en); pcr->aspm_enabled = enable; } static void rts5261_disable_aspm(struct rtsx_pcr *pcr, bool enable) { - u8 val = 0; - if (pcr->aspm_enabled == enable) return; - val = 0; - rtsx_pci_update_cfg_byte(pcr, pcr->pcie_cap + PCI_EXP_LNKCTL, - ASPM_MASK_NEG, val); + pcie_capability_clear_and_set_word(pcr->pci, PCI_EXP_LNKCTL, + PCI_EXP_LNKCTL_ASPMC, 0); rtsx_pci_write_register(pcr, SD_CFG1, SD_ASYNC_FIFO_NOT_RST, 0); udelay(10); pcr->aspm_enabled = enable; |