Skip to content

Commit

Permalink
misc: rtsx: Simplify rtsx_comm_set_aspm()
Browse files Browse the repository at this point in the history
Simplify rtsx_comm_set_aspm() and remove the now-unused
rtsx_pci_enable_aspm().

rtsx_pci_disable_aspm() is still used by rtsx_pci_init_hw().

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20200521180545.1159896-6-helgaas@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Bjorn Helgaas authored and Greg Kroah-Hartman committed May 22, 2020
1 parent 3d1e7aa commit 05ffe36
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions drivers/misc/cardreader/rtsx_pcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ static const struct pci_device_id rtsx_pci_ids[] = {

MODULE_DEVICE_TABLE(pci, rtsx_pci_ids);

static inline void rtsx_pci_enable_aspm(struct rtsx_pcr *pcr)
{
pcie_capability_clear_and_set_word(pcr->pci, PCI_EXP_LNKCTL,
PCI_EXP_LNKCTL_ASPMC, pcr->aspm_en);
}

static inline void rtsx_pci_disable_aspm(struct rtsx_pcr *pcr)
{
pcie_capability_clear_and_set_word(pcr->pci, PCI_EXP_LNKCTL,
Expand Down Expand Up @@ -93,10 +87,9 @@ static void rtsx_comm_set_aspm(struct rtsx_pcr *pcr, bool enable)
if (pcr->aspm_enabled == enable)
return;

if (enable)
rtsx_pci_enable_aspm(pcr);
else
rtsx_pci_disable_aspm(pcr);
pcie_capability_clear_and_set_word(pcr->pci, PCI_EXP_LNKCTL,
PCI_EXP_LNKCTL_ASPMC,
enable ? pcr->aspm_en : 0);

pcr->aspm_enabled = enable;
}
Expand Down

0 comments on commit 05ffe36

Please sign in to comment.