Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: sdhci: Remove redundant runtime PM calls

Commit 9250aea76bfc ("mmc: core: Enable runtime PM management of host
devices"), made some calls to the runtime PM API from the driver
redundant. Especially those which deals with runtime PM reference
counting, so let's remove them.

Moreover as SDHCI have its own wrapper functions for runtime PM these
becomes superfluous, so let's remove them as well.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>

+4 -51
+4 -51
drivers/mmc/host/sdhci.c
··· 56 56 static int sdhci_do_get_cd(struct sdhci_host *host); 57 57 58 58 #ifdef CONFIG_PM 59 - static int sdhci_runtime_pm_get(struct sdhci_host *host); 60 - static int sdhci_runtime_pm_put(struct sdhci_host *host); 61 59 static void sdhci_runtime_pm_bus_on(struct sdhci_host *host); 62 60 static void sdhci_runtime_pm_bus_off(struct sdhci_host *host); 63 61 #else 64 - static inline int sdhci_runtime_pm_get(struct sdhci_host *host) 65 - { 66 - return 0; 67 - } 68 - static inline int sdhci_runtime_pm_put(struct sdhci_host *host) 69 - { 70 - return 0; 71 - } 72 62 static void sdhci_runtime_pm_bus_on(struct sdhci_host *host) 73 63 { 74 64 } ··· 1309 1319 1310 1320 host = mmc_priv(mmc); 1311 1321 1312 - sdhci_runtime_pm_get(host); 1313 - 1314 1322 /* Firstly check card presence */ 1315 1323 present = mmc->ops->get_cd(mmc); 1316 1324 ··· 1555 1567 { 1556 1568 struct sdhci_host *host = mmc_priv(mmc); 1557 1569 1558 - sdhci_runtime_pm_get(host); 1559 1570 sdhci_do_set_ios(host, ios); 1560 - sdhci_runtime_pm_put(host); 1561 1571 } 1562 1572 1563 1573 static int sdhci_do_get_cd(struct sdhci_host *host) ··· 1587 1601 static int sdhci_get_cd(struct mmc_host *mmc) 1588 1602 { 1589 1603 struct sdhci_host *host = mmc_priv(mmc); 1590 - int ret; 1591 1604 1592 - sdhci_runtime_pm_get(host); 1593 - ret = sdhci_do_get_cd(host); 1594 - sdhci_runtime_pm_put(host); 1595 - return ret; 1605 + return sdhci_do_get_cd(host); 1596 1606 } 1597 1607 1598 1608 static int sdhci_check_ro(struct sdhci_host *host) ··· 1644 1662 static int sdhci_get_ro(struct mmc_host *mmc) 1645 1663 { 1646 1664 struct sdhci_host *host = mmc_priv(mmc); 1647 - int ret; 1648 1665 1649 - sdhci_runtime_pm_get(host); 1650 - ret = sdhci_do_get_ro(host); 1651 - sdhci_runtime_pm_put(host); 1652 - return ret; 1666 + return sdhci_do_get_ro(host); 1653 1667 } 1654 1668 1655 1669 static void sdhci_enable_sdio_irq_nolock(struct sdhci_host *host, int enable) ··· 1667 1689 struct sdhci_host *host = mmc_priv(mmc); 1668 1690 unsigned long flags; 1669 1691 1670 - sdhci_runtime_pm_get(host); 1671 - 1672 1692 spin_lock_irqsave(&host->lock, flags); 1673 1693 if (enable) 1674 1694 host->flags |= SDHCI_SDIO_IRQ_ENABLED; ··· 1675 1699 1676 1700 sdhci_enable_sdio_irq_nolock(host, enable); 1677 1701 spin_unlock_irqrestore(&host->lock, flags); 1678 - 1679 - sdhci_runtime_pm_put(host); 1680 1702 } 1681 1703 1682 1704 static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host, ··· 1772 1798 struct mmc_ios *ios) 1773 1799 { 1774 1800 struct sdhci_host *host = mmc_priv(mmc); 1775 - int err; 1776 1801 1777 1802 if (host->version < SDHCI_SPEC_300) 1778 1803 return 0; 1779 - sdhci_runtime_pm_get(host); 1780 - err = sdhci_do_start_signal_voltage_switch(host, ios); 1781 - sdhci_runtime_pm_put(host); 1782 - return err; 1804 + 1805 + return sdhci_do_start_signal_voltage_switch(host, ios); 1783 1806 } 1784 1807 1785 1808 static int sdhci_card_busy(struct mmc_host *mmc) ··· 1784 1813 struct sdhci_host *host = mmc_priv(mmc); 1785 1814 u32 present_state; 1786 1815 1787 - sdhci_runtime_pm_get(host); 1788 1816 /* Check whether DAT[3:0] is 0000 */ 1789 1817 present_state = sdhci_readl(host, SDHCI_PRESENT_STATE); 1790 - sdhci_runtime_pm_put(host); 1791 1818 1792 1819 return !(present_state & SDHCI_DATA_LVL_MASK); 1793 1820 } ··· 1812 1843 unsigned int tuning_count = 0; 1813 1844 bool hs400_tuning; 1814 1845 1815 - sdhci_runtime_pm_get(host); 1816 1846 spin_lock_irqsave(&host->lock, flags); 1817 1847 1818 1848 hs400_tuning = host->flags & SDHCI_HS400_TUNING; ··· 1859 1891 if (host->ops->platform_execute_tuning) { 1860 1892 spin_unlock_irqrestore(&host->lock, flags); 1861 1893 err = host->ops->platform_execute_tuning(host, opcode); 1862 - sdhci_runtime_pm_put(host); 1863 1894 return err; 1864 1895 } 1865 1896 ··· 1990 2023 sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); 1991 2024 out_unlock: 1992 2025 spin_unlock_irqrestore(&host->lock, flags); 1993 - sdhci_runtime_pm_put(host); 1994 - 1995 2026 return err; 1996 2027 } 1997 2028 ··· 2187 2222 spin_unlock_irqrestore(&host->lock, flags); 2188 2223 2189 2224 mmc_request_done(host->mmc, mrq); 2190 - sdhci_runtime_pm_put(host); 2191 2225 } 2192 2226 2193 2227 static void sdhci_timeout_timer(unsigned long data) ··· 2666 2702 } 2667 2703 2668 2704 EXPORT_SYMBOL_GPL(sdhci_resume_host); 2669 - 2670 - static int sdhci_runtime_pm_get(struct sdhci_host *host) 2671 - { 2672 - return pm_runtime_get_sync(host->mmc->parent); 2673 - } 2674 - 2675 - static int sdhci_runtime_pm_put(struct sdhci_host *host) 2676 - { 2677 - pm_runtime_mark_last_busy(host->mmc->parent); 2678 - return pm_runtime_put_autosuspend(host->mmc->parent); 2679 - } 2680 2705 2681 2706 static void sdhci_runtime_pm_bus_on(struct sdhci_host *host) 2682 2707 {