Skip to contentSkip to conversation

mmc: sdhci-pci: Remove unused member cd_con_id

PATCH Applied Andy Shevchenko 3 participants 5 messages Jan 2, 2017 – Jan 12, 2017

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 2/2 mmc: slot-gpio: Don't override con_id when request descriptor

In reply to Andy Shevchenko

The caller may supply connection ID, index, or both. All combinations are possible and mmc framework should not make any assumption on what exactly caller wants.

Remove con_id override conditionals in mmc_gpiod_request_ro() and mmc_gpiod_request_cd().

---
 drivers/mmc/core/slot-gpio.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/mmc/core/slot-gpio.c +0 -6
index babe591aea96..a8450a8701e4 100644
@@ -235,9 +235,6 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
 	struct gpio_desc *desc;
 	int ret;
 
-	if (!con_id)
-		con_id = ctx->cd_label;
-
 	desc = devm_gpiod_get_index(host->parent, con_id, idx, GPIOD_IN);
 	if (IS_ERR(desc))
 		return PTR_ERR(desc);
@@ -289,9 +286,6 @@ int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id,
 	struct gpio_desc *desc;
 	int ret;
 
-	if (!con_id)
-		con_id = ctx->ro_label;
-
 	desc = devm_gpiod_get_index(host->parent, con_id, idx, GPIOD_IN);
 	if (IS_ERR(desc))
 		return PTR_ERR(desc);
Signature · 1 line
2.11.0
#0 lore raw

PATCH 1/2 mmc: sdhci-pci: Remove unused member cd_con_id

cd_con_id is not used and always NULL.
Remove it to make code a bit more cleaner.

---
 drivers/mmc/host/sdhci-pci-core.c | 3 +--
 drivers/mmc/host/sdhci-pci.h      | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/mmc/host/sdhci-pci-core.c +1 -2
index 1a72d32af07f..5c275b7d0d53 100644
@@ -424,7 +424,6 @@ static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot)
 static int byt_sd_probe_slot(struct sdhci_pci_slot *slot)
 {
 	slot->host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY;
-	slot->cd_con_id = NULL;
 	slot->cd_idx = 0;
 	slot->cd_override_level = true;
 	if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXT_SD ||
@@ -1817,7 +1816,7 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(
 	host->mmc->caps2 |= MMC_CAP2_NO_PRESCAN_POWERUP;
 
 	if (slot->cd_idx >= 0) {
-		ret = mmc_gpiod_request_cd(host->mmc, slot->cd_con_id, slot->cd_idx,
+		ret = mmc_gpiod_request_cd(host->mmc, NULL, slot->cd_idx,
 					   slot->cd_override_level, 0, NULL);
 		if (ret == -EPROBE_DEFER)
 			goto remove;
drivers/mmc/host/sdhci-pci.h +0 -1
index 4abdaed72bd4..36f743464fcc 100644
@@ -81,7 +81,6 @@ struct sdhci_pci_slot {
 	int			cd_gpio;
 	int			cd_irq;
 
-	char			*cd_con_id;
 	int			cd_idx;
 	bool			cd_override_level;
 
Signature · 1 line
2.11.0
maintainer Acked-by on v1 1/2
#3 lore raw
Quoted 4 lines · Andy Shevchenko

cd_con_id is not used and always NULL.
Remove it to make code a bit more cleaner.

Quoted 39 lines
---
 drivers/mmc/host/sdhci-pci-core.c | 3 +--
 drivers/mmc/host/sdhci-pci.h      | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/mmc/host/sdhci-pci-core.c +1 -2
index 1a72d32af07f..5c275b7d0d53 100644
@@ -424,7 +424,6 @@ static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot)
 static int byt_sd_probe_slot(struct sdhci_pci_slot *slot)
 {
 	slot->host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY;
-	slot->cd_con_id = NULL;
 	slot->cd_idx = 0;
 	slot->cd_override_level = true;
 	if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXT_SD ||
@@ -1817,7 +1816,7 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(
 	host->mmc->caps2 |= MMC_CAP2_NO_PRESCAN_POWERUP;
 
 	if (slot->cd_idx >= 0) {
-		ret = mmc_gpiod_request_cd(host->mmc, slot->cd_con_id, slot->cd_idx,
+		ret = mmc_gpiod_request_cd(host->mmc, NULL, slot->cd_idx,
 					   slot->cd_override_level, 0, NULL);
 		if (ret == -EPROBE_DEFER)
 			goto remove;
drivers/mmc/host/sdhci-pci.h +0 -1
index 4abdaed72bd4..36f743464fcc 100644
@@ -81,7 +81,6 @@ struct sdhci_pci_slot {
 	int			cd_gpio;
 	int			cd_irq;
 
-	char			*cd_con_id;
 	int			cd_idx;
 	bool			cd_override_level;
 
Applied
#4 lore raw
In reply to Andy Shevchenko
Quoted 4 lines · Andy Shevchenko

cd_con_id is not used and always NULL.
Remove it to make code a bit more cleaner.

Thanks, applied for next!

Kind regards
Uffe

Quoted 41 lines
---
 drivers/mmc/host/sdhci-pci-core.c | 3 +--
 drivers/mmc/host/sdhci-pci.h      | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/mmc/host/sdhci-pci-core.c +1 -2
index 1a72d32af07f..5c275b7d0d53 100644
@@ -424,7 +424,6 @@ static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot)
 static int byt_sd_probe_slot(struct sdhci_pci_slot *slot)
 {
        slot->host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY;
-       slot->cd_con_id = NULL;
        slot->cd_idx = 0;
        slot->cd_override_level = true;
        if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXT_SD ||
@@ -1817,7 +1816,7 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(
        host->mmc->caps2 |= MMC_CAP2_NO_PRESCAN_POWERUP;
 
        if (slot->cd_idx >= 0) {
-               ret = mmc_gpiod_request_cd(host->mmc, slot->cd_con_id, slot->cd_idx,
+               ret = mmc_gpiod_request_cd(host->mmc, NULL, slot->cd_idx,
                                           slot->cd_override_level, 0, NULL);
                if (ret == -EPROBE_DEFER)
                        goto remove;
drivers/mmc/host/sdhci-pci.h +0 -2
index 4abdaed72bd4..36f743464fcc 100644
@@ -81,7 +81,6 @@ struct sdhci_pci_slot {
        int                     cd_gpio;
        int                     cd_irq;
 
-       char                    *cd_con_id;
        int                     cd_idx;
        bool                    cd_override_level;
 
--

2.11.0

Applied
#2 lore raw

Re: [PATCH v1 2/2] mmc: slot-gpio: Don't override con_id when request descriptor

In reply to Andy Shevchenko
Quoted 9 lines · Andy Shevchenko

The caller may supply connection ID, index, or both. All combinations are possible and mmc framework should not make any assumption on what exactly caller wants.

Remove con_id override conditionals in mmc_gpiod_request_ro() and mmc_gpiod_request_cd().

Thanks, applied for next!

Kind regards
Uffe

Quoted 31 lines
---
 drivers/mmc/core/slot-gpio.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/mmc/core/slot-gpio.c +0 -7
index babe591aea96..a8450a8701e4 100644
@@ -235,9 +235,6 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
        struct gpio_desc *desc;
        int ret;
 
-       if (!con_id)
-               con_id = ctx->cd_label;
-
        desc = devm_gpiod_get_index(host->parent, con_id, idx, GPIOD_IN);
        if (IS_ERR(desc))
                return PTR_ERR(desc);
@@ -289,9 +286,6 @@ int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id,
        struct gpio_desc *desc;
        int ret;
 
-       if (!con_id)
-               con_id = ctx->ro_label;
-
        desc = devm_gpiod_get_index(host->parent, con_id, idx, GPIOD_IN);
        if (IS_ERR(desc))
                return PTR_ERR(desc);
--

2.11.0