* [PATCH v3 7/8] mmc: dw_mmc: remove the dw_mci_of_cd_gpio()
@ 2014-02-03 11:15 Jaehoon Chung
2014-02-06 11:26 ` Seungwon Jeon
0 siblings, 1 reply; 3+ messages in thread
From: Jaehoon Chung @ 2014-02-03 11:15 UTC (permalink / raw)
To: linux-mmc@vger.kernel.org; +Cc: Chris Ball, Seungwon Jeon
If mmc_of_parse() is used, dw_mci_of_get_cd_gpio didn't need.
Already implemented into mmc_of_parse().
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
Changelog V3:
-None
drivers/mmc/host/dw_mmc.c | 26 --------------------------
1 file changed, 26 deletions(-)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 2f40593..ac2907d 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2048,26 +2048,6 @@ static int dw_mci_of_get_wp_gpio(struct device *dev, u8 slot)
return gpio;
}
-
-/* find the cd gpio for a given slot */
-static void dw_mci_of_get_cd_gpio(struct device *dev, u8 slot,
- struct mmc_host *mmc)
-{
- struct device_node *np = dw_mci_of_find_slot_node(dev, slot);
- int gpio;
-
- if (!np)
- return;
-
- gpio = of_get_named_gpio(np, "cd-gpios", 0);
-
- /* Having a missing entry is valid; return silently */
- if (!gpio_is_valid(gpio))
- return;
-
- if (mmc_gpio_request_cd(mmc, gpio, 0))
- dev_warn(dev, "gpio [%d] request failed\n", gpio);
-}
#else /* CONFIG_OF */
static int dw_mci_of_get_slot_quirks(struct device *dev, u8 slot)
{
@@ -2081,11 +2061,6 @@ static int dw_mci_of_get_wp_gpio(struct device *dev, u8 slot)
{
return -EINVAL;
}
-static void dw_mci_of_get_cd_gpio(struct device *dev, u8 slot,
- struct mmc_host *mmc)
-{
- return;
-}
#endif /* CONFIG_OF */
static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
@@ -2165,7 +2140,6 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
}
slot->wp_gpio = dw_mci_of_get_wp_gpio(host->dev, slot->id);
- dw_mci_of_get_cd_gpio(host->dev, slot->id, mmc);
ret = mmc_add_host(mmc);
if (ret)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH v3 7/8] mmc: dw_mmc: remove the dw_mci_of_cd_gpio()
2014-02-03 11:15 [PATCH v3 7/8] mmc: dw_mmc: remove the dw_mci_of_cd_gpio() Jaehoon Chung
@ 2014-02-06 11:26 ` Seungwon Jeon
2014-02-07 2:44 ` Jaehoon Chung
0 siblings, 1 reply; 3+ messages in thread
From: Seungwon Jeon @ 2014-02-06 11:26 UTC (permalink / raw)
To: 'Jaehoon Chung', linux-mmc; +Cc: 'Chris Ball'
On Mon, February 03, 2014, Jaehoon Chung wrote:
> If mmc_of_parse() is used, dw_mci_of_get_cd_gpio didn't need.
> Already implemented into mmc_of_parse().
Can be this done in 2/8(mmc: dw_mmc: use the mmc_of_parse() instead of local parser) together?
Additionally we have a chance to remove 'write protect gpio' part including dw_mci_of_get_wp_gpio() now.
mmc_of_parse() also has those.
Can you address more?
Thanks,
Seungwon Jeon
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
> Changelog V3:
> -None
>
> drivers/mmc/host/dw_mmc.c | 26 --------------------------
> 1 file changed, 26 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 2f40593..ac2907d 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -2048,26 +2048,6 @@ static int dw_mci_of_get_wp_gpio(struct device *dev, u8 slot)
>
> return gpio;
> }
> -
> -/* find the cd gpio for a given slot */
> -static void dw_mci_of_get_cd_gpio(struct device *dev, u8 slot,
> - struct mmc_host *mmc)
> -{
> - struct device_node *np = dw_mci_of_find_slot_node(dev, slot);
> - int gpio;
> -
> - if (!np)
> - return;
> -
> - gpio = of_get_named_gpio(np, "cd-gpios", 0);
> -
> - /* Having a missing entry is valid; return silently */
> - if (!gpio_is_valid(gpio))
> - return;
> -
> - if (mmc_gpio_request_cd(mmc, gpio, 0))
> - dev_warn(dev, "gpio [%d] request failed\n", gpio);
> -}
> #else /* CONFIG_OF */
> static int dw_mci_of_get_slot_quirks(struct device *dev, u8 slot)
> {
> @@ -2081,11 +2061,6 @@ static int dw_mci_of_get_wp_gpio(struct device *dev, u8 slot)
> {
> return -EINVAL;
> }
> -static void dw_mci_of_get_cd_gpio(struct device *dev, u8 slot,
> - struct mmc_host *mmc)
> -{
> - return;
> -}
> #endif /* CONFIG_OF */
>
> static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
> @@ -2165,7 +2140,6 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
> }
>
> slot->wp_gpio = dw_mci_of_get_wp_gpio(host->dev, slot->id);
> - dw_mci_of_get_cd_gpio(host->dev, slot->id, mmc);
>
> ret = mmc_add_host(mmc);
> if (ret)
> --
> 1.7.9.5
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3 7/8] mmc: dw_mmc: remove the dw_mci_of_cd_gpio()
2014-02-06 11:26 ` Seungwon Jeon
@ 2014-02-07 2:44 ` Jaehoon Chung
0 siblings, 0 replies; 3+ messages in thread
From: Jaehoon Chung @ 2014-02-07 2:44 UTC (permalink / raw)
To: Seungwon Jeon, linux-mmc; +Cc: 'Chris Ball'
On 02/06/2014 08:26 PM, Seungwon Jeon wrote:
> On Mon, February 03, 2014, Jaehoon Chung wrote:
>> If mmc_of_parse() is used, dw_mci_of_get_cd_gpio didn't need.
>> Already implemented into mmc_of_parse().
>
> Can be this done in 2/8(mmc: dw_mmc: use the mmc_of_parse() instead of local parser) together?
> Additionally we have a chance to remove 'write protect gpio' part including dw_mci_of_get_wp_gpio() now.
> mmc_of_parse() also has those.
> Can you address more?
Sure! It can be removed also. I will update it.
Best Regards,
Jaehoon Chung
>
> Thanks,
> Seungwon Jeon
>
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>> ---
>> Changelog V3:
>> -None
>>
>> drivers/mmc/host/dw_mmc.c | 26 --------------------------
>> 1 file changed, 26 deletions(-)
>>
>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>> index 2f40593..ac2907d 100644
>> --- a/drivers/mmc/host/dw_mmc.c
>> +++ b/drivers/mmc/host/dw_mmc.c
>> @@ -2048,26 +2048,6 @@ static int dw_mci_of_get_wp_gpio(struct device *dev, u8 slot)
>>
>> return gpio;
>> }
>> -
>> -/* find the cd gpio for a given slot */
>> -static void dw_mci_of_get_cd_gpio(struct device *dev, u8 slot,
>> - struct mmc_host *mmc)
>> -{
>> - struct device_node *np = dw_mci_of_find_slot_node(dev, slot);
>> - int gpio;
>> -
>> - if (!np)
>> - return;
>> -
>> - gpio = of_get_named_gpio(np, "cd-gpios", 0);
>> -
>> - /* Having a missing entry is valid; return silently */
>> - if (!gpio_is_valid(gpio))
>> - return;
>> -
>> - if (mmc_gpio_request_cd(mmc, gpio, 0))
>> - dev_warn(dev, "gpio [%d] request failed\n", gpio);
>> -}
>> #else /* CONFIG_OF */
>> static int dw_mci_of_get_slot_quirks(struct device *dev, u8 slot)
>> {
>> @@ -2081,11 +2061,6 @@ static int dw_mci_of_get_wp_gpio(struct device *dev, u8 slot)
>> {
>> return -EINVAL;
>> }
>> -static void dw_mci_of_get_cd_gpio(struct device *dev, u8 slot,
>> - struct mmc_host *mmc)
>> -{
>> - return;
>> -}
>> #endif /* CONFIG_OF */
>>
>> static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
>> @@ -2165,7 +2140,6 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
>> }
>>
>> slot->wp_gpio = dw_mci_of_get_wp_gpio(host->dev, slot->id);
>> - dw_mci_of_get_cd_gpio(host->dev, slot->id, mmc);
>>
>> ret = mmc_add_host(mmc);
>> if (ret)
>> --
>> 1.7.9.5
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-07 2:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-03 11:15 [PATCH v3 7/8] mmc: dw_mmc: remove the dw_mci_of_cd_gpio() Jaehoon Chung
2014-02-06 11:26 ` Seungwon Jeon
2014-02-07 2:44 ` Jaehoon Chung
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).