* [PATCH] mmc: dw_mmc: remove "disable-wp" property
@ 2016-01-18 9:50 Shawn Lin
2016-01-18 10:13 ` Jaehoon Chung
0 siblings, 1 reply; 2+ messages in thread
From: Shawn Lin @ 2016-01-18 9:50 UTC (permalink / raw)
To: Jaehoon Chung, Ulf Hansson; +Cc: linux-mmc, linux-kernel, Shawn Lin
dw_mmc already use mmc_of_parse to get disable-wp,
so we remove it from dw_mmc. And dw_mci_slot_of_parse
will not be removed as well.
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---
drivers/mmc/host/dw_mmc.c | 43 -------------------------------------------
1 file changed, 43 deletions(-)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index fddbcb6..8687554 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2493,47 +2493,6 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
-#ifdef CONFIG_OF
-/* given a slot, find out the device node representing that slot */
-static struct device_node *dw_mci_of_find_slot_node(struct dw_mci_slot *slot)
-{
- struct device *dev = slot->mmc->parent;
- struct device_node *np;
- const __be32 *addr;
- int len;
-
- if (!dev || !dev->of_node)
- return NULL;
-
- for_each_child_of_node(dev->of_node, np) {
- addr = of_get_property(np, "reg", &len);
- if (!addr || (len < sizeof(int)))
- continue;
- if (be32_to_cpup(addr) == slot->id)
- return np;
- }
- return NULL;
-}
-
-static void dw_mci_slot_of_parse(struct dw_mci_slot *slot)
-{
- struct device_node *np = dw_mci_of_find_slot_node(slot);
-
- if (!np)
- return;
-
- if (of_property_read_bool(np, "disable-wp")) {
- slot->mmc->caps2 |= MMC_CAP2_NO_WRITE_PROTECT;
- dev_warn(slot->mmc->parent,
- "Slot quirk 'disable-wp' is deprecated\n");
- }
-}
-#else /* CONFIG_OF */
-static void dw_mci_slot_of_parse(struct dw_mci_slot *slot)
-{
-}
-#endif /* CONFIG_OF */
-
static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
{
struct mmc_host *mmc;
@@ -2590,8 +2549,6 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
if (host->pdata->caps2)
mmc->caps2 = host->pdata->caps2;
- dw_mci_slot_of_parse(slot);
-
ret = mmc_of_parse(mmc);
if (ret)
goto err_host_allocated;
--
2.3.7
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] mmc: dw_mmc: remove "disable-wp" property
2016-01-18 9:50 [PATCH] mmc: dw_mmc: remove "disable-wp" property Shawn Lin
@ 2016-01-18 10:13 ` Jaehoon Chung
0 siblings, 0 replies; 2+ messages in thread
From: Jaehoon Chung @ 2016-01-18 10:13 UTC (permalink / raw)
To: Shawn Lin, Ulf Hansson; +Cc: linux-mmc, linux-kernel
Hi, Shawn.
On 01/18/2016 06:50 PM, Shawn Lin wrote:
> dw_mmc already use mmc_of_parse to get disable-wp,
> so we remove it from dw_mmc. And dw_mci_slot_of_parse
> will not be removed as well.
Yes, it's already used "mmc_of_parse".
You can see "slot quirks 'disable-wp' is deprecated".
Since the properties was included in slot regs before using "mmc_of_parse".
So we chosen to print the message "deprecated" to prevent the developer's confusion.
At this time, actually, i think there are no developers who confused this.
I will consider more about this patch.
Thanks!
Best Regards,
Jaehoon Chung
>
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
> ---
>
> drivers/mmc/host/dw_mmc.c | 43 -------------------------------------------
> 1 file changed, 43 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index fddbcb6..8687554 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -2493,47 +2493,6 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
> return IRQ_HANDLED;
> }
>
> -#ifdef CONFIG_OF
> -/* given a slot, find out the device node representing that slot */
> -static struct device_node *dw_mci_of_find_slot_node(struct dw_mci_slot *slot)
> -{
> - struct device *dev = slot->mmc->parent;
> - struct device_node *np;
> - const __be32 *addr;
> - int len;
> -
> - if (!dev || !dev->of_node)
> - return NULL;
> -
> - for_each_child_of_node(dev->of_node, np) {
> - addr = of_get_property(np, "reg", &len);
> - if (!addr || (len < sizeof(int)))
> - continue;
> - if (be32_to_cpup(addr) == slot->id)
> - return np;
> - }
> - return NULL;
> -}
> -
> -static void dw_mci_slot_of_parse(struct dw_mci_slot *slot)
> -{
> - struct device_node *np = dw_mci_of_find_slot_node(slot);
> -
> - if (!np)
> - return;
> -
> - if (of_property_read_bool(np, "disable-wp")) {
> - slot->mmc->caps2 |= MMC_CAP2_NO_WRITE_PROTECT;
> - dev_warn(slot->mmc->parent,
> - "Slot quirk 'disable-wp' is deprecated\n");
> - }
> -}
> -#else /* CONFIG_OF */
> -static void dw_mci_slot_of_parse(struct dw_mci_slot *slot)
> -{
> -}
> -#endif /* CONFIG_OF */
> -
> static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
> {
> struct mmc_host *mmc;
> @@ -2590,8 +2549,6 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
> if (host->pdata->caps2)
> mmc->caps2 = host->pdata->caps2;
>
> - dw_mci_slot_of_parse(slot);
> -
> ret = mmc_of_parse(mmc);
> if (ret)
> goto err_host_allocated;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-18 10:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-18 9:50 [PATCH] mmc: dw_mmc: remove "disable-wp" property Shawn Lin
2016-01-18 10:13 ` Jaehoon Chung
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.