All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] mmc: sdhci-pci: Remove unused member cd_con_id
@ 2017-01-02 12:05 Andy Shevchenko
  2017-01-02 12:05 ` [PATCH v1 2/2] mmc: slot-gpio: Don't override con_id when request descriptor Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andy Shevchenko @ 2017-01-02 12:05 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc, Adrian Hunter; +Cc: Andy Shevchenko

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

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mmc/host/sdhci-pci-core.c | 3 +--
 drivers/mmc/host/sdhci-pci.h      | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
index 1a72d32af07f..5c275b7d0d53 100644
--- a/drivers/mmc/host/sdhci-pci-core.c
+++ b/drivers/mmc/host/sdhci-pci-core.c
@@ -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;
diff --git a/drivers/mmc/host/sdhci-pci.h b/drivers/mmc/host/sdhci-pci.h
index 4abdaed72bd4..36f743464fcc 100644
--- a/drivers/mmc/host/sdhci-pci.h
+++ b/drivers/mmc/host/sdhci-pci.h
@@ -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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v1 2/2] mmc: slot-gpio: Don't override con_id when request descriptor
  2017-01-02 12:05 [PATCH v1 1/2] mmc: sdhci-pci: Remove unused member cd_con_id Andy Shevchenko
@ 2017-01-02 12:05 ` Andy Shevchenko
  2017-01-12 12:00   ` Ulf Hansson
  2017-01-03 14:12 ` [PATCH v1 1/2] mmc: sdhci-pci: Remove unused member cd_con_id Adrian Hunter
  2017-01-12 12:00 ` Ulf Hansson
  2 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2017-01-02 12:05 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc, Adrian Hunter; +Cc: 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().

Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mmc/core/slot-gpio.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c
index babe591aea96..a8450a8701e4 100644
--- a/drivers/mmc/core/slot-gpio.c
+++ b/drivers/mmc/core/slot-gpio.c
@@ -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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/2] mmc: sdhci-pci: Remove unused member cd_con_id
  2017-01-02 12:05 [PATCH v1 1/2] mmc: sdhci-pci: Remove unused member cd_con_id Andy Shevchenko
  2017-01-02 12:05 ` [PATCH v1 2/2] mmc: slot-gpio: Don't override con_id when request descriptor Andy Shevchenko
@ 2017-01-03 14:12 ` Adrian Hunter
  2017-01-12 12:00 ` Ulf Hansson
  2 siblings, 0 replies; 5+ messages in thread
From: Adrian Hunter @ 2017-01-03 14:12 UTC (permalink / raw)
  To: Andy Shevchenko, Ulf Hansson, linux-mmc

On 02/01/17 14:05, Andy Shevchenko wrote:
> cd_con_id is not used and always NULL.
> Remove it to make code a bit more cleaner.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/sdhci-pci-core.c | 3 +--
>  drivers/mmc/host/sdhci-pci.h      | 1 -
>  2 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
> index 1a72d32af07f..5c275b7d0d53 100644
> --- a/drivers/mmc/host/sdhci-pci-core.c
> +++ b/drivers/mmc/host/sdhci-pci-core.c
> @@ -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;
> diff --git a/drivers/mmc/host/sdhci-pci.h b/drivers/mmc/host/sdhci-pci.h
> index 4abdaed72bd4..36f743464fcc 100644
> --- a/drivers/mmc/host/sdhci-pci.h
> +++ b/drivers/mmc/host/sdhci-pci.h
> @@ -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;
>  
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/2] mmc: sdhci-pci: Remove unused member cd_con_id
  2017-01-02 12:05 [PATCH v1 1/2] mmc: sdhci-pci: Remove unused member cd_con_id Andy Shevchenko
  2017-01-02 12:05 ` [PATCH v1 2/2] mmc: slot-gpio: Don't override con_id when request descriptor Andy Shevchenko
  2017-01-03 14:12 ` [PATCH v1 1/2] mmc: sdhci-pci: Remove unused member cd_con_id Adrian Hunter
@ 2017-01-12 12:00 ` Ulf Hansson
  2 siblings, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2017-01-12 12:00 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-mmc, Adrian Hunter

On 2 January 2017 at 13:05, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> cd_con_id is not used and always NULL.
> Remove it to make code a bit more cleaner.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/host/sdhci-pci-core.c | 3 +--
>  drivers/mmc/host/sdhci-pci.h      | 1 -
>  2 files changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
> index 1a72d32af07f..5c275b7d0d53 100644
> --- a/drivers/mmc/host/sdhci-pci-core.c
> +++ b/drivers/mmc/host/sdhci-pci-core.c
> @@ -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;
> diff --git a/drivers/mmc/host/sdhci-pci.h b/drivers/mmc/host/sdhci-pci.h
> index 4abdaed72bd4..36f743464fcc 100644
> --- a/drivers/mmc/host/sdhci-pci.h
> +++ b/drivers/mmc/host/sdhci-pci.h
> @@ -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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 2/2] mmc: slot-gpio: Don't override con_id when request descriptor
  2017-01-02 12:05 ` [PATCH v1 2/2] mmc: slot-gpio: Don't override con_id when request descriptor Andy Shevchenko
@ 2017-01-12 12:00   ` Ulf Hansson
  0 siblings, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2017-01-12 12:00 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-mmc, Adrian Hunter

On 2 January 2017 at 13:05, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> 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().
>
> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/core/slot-gpio.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c
> index babe591aea96..a8450a8701e4 100644
> --- a/drivers/mmc/core/slot-gpio.c
> +++ b/drivers/mmc/core/slot-gpio.c
> @@ -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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-12 12:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-02 12:05 [PATCH v1 1/2] mmc: sdhci-pci: Remove unused member cd_con_id Andy Shevchenko
2017-01-02 12:05 ` [PATCH v1 2/2] mmc: slot-gpio: Don't override con_id when request descriptor Andy Shevchenko
2017-01-12 12:00   ` Ulf Hansson
2017-01-03 14:12 ` [PATCH v1 1/2] mmc: sdhci-pci: Remove unused member cd_con_id Adrian Hunter
2017-01-12 12:00 ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.