* [PATCH v2] mmc: mxs-mmc: Remove platform data
@ 2012-10-31 11:22 Fabio Estevam
2012-10-31 15:45 ` Shawn Guo
2012-10-31 16:38 ` Marek Vasut
0 siblings, 2 replies; 5+ messages in thread
From: Fabio Estevam @ 2012-10-31 11:22 UTC (permalink / raw)
To: cjb; +Cc: shawn.guo, marex, linux-mmc, Fabio Estevam
From: Fabio Estevam <fabio.estevam@freescale.com>
All MXS users have been converted to device tree and the board files have been
removed.
No need to keep platform data in the driver.
Also move bus_width declaration in the beggining of mxs_mmc_probe() to avoid:
'warning: ISO C90 forbids mixed declarations and code'.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
----
Changes since v1:
- Also remove mxs_mmc_platform_data and linux/mmc/mxs-mmc.h, which was used only
to include mxs_mmc_platform_data definition.
drivers/mmc/host/mxs-mmc.c | 31 ++++++++++---------------------
include/linux/mmc/mxs-mmc.h | 19 -------------------
2 files changed, 10 insertions(+), 40 deletions(-)
delete mode 100644 include/linux/mmc/mxs-mmc.h
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 80d1e6d..206fe49 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -43,7 +43,6 @@
#include <linux/module.h>
#include <linux/pinctrl/consumer.h>
#include <linux/stmp_device.h>
-#include <linux/mmc/mxs-mmc.h>
#include <linux/spi/mxs-spi.h>
#define DRIVER_NAME "mxs-mmc"
@@ -593,13 +592,13 @@ static int mxs_mmc_probe(struct platform_device *pdev)
struct mxs_mmc_host *host;
struct mmc_host *mmc;
struct resource *iores, *dmares;
- struct mxs_mmc_platform_data *pdata;
struct pinctrl *pinctrl;
int ret = 0, irq_err, irq_dma;
dma_cap_mask_t mask;
struct regulator *reg_vmmc;
enum of_gpio_flags flags;
struct mxs_ssp *ssp;
+ u32 bus_width = 0;
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
@@ -682,25 +681,15 @@ static int mxs_mmc_probe(struct platform_device *pdev)
mmc->caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED |
MMC_CAP_SDIO_IRQ | MMC_CAP_NEEDS_POLL;
- pdata = mmc_dev(host->mmc)->platform_data;
- if (!pdata) {
- u32 bus_width = 0;
- of_property_read_u32(np, "bus-width", &bus_width);
- if (bus_width == 4)
- mmc->caps |= MMC_CAP_4_BIT_DATA;
- else if (bus_width == 8)
- mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
- host->wp_gpio = of_get_named_gpio_flags(np, "wp-gpios", 0,
- &flags);
- if (flags & OF_GPIO_ACTIVE_LOW)
- host->wp_inverted = 1;
- } else {
- if (pdata->flags & SLOTF_8_BIT_CAPABLE)
- mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
- if (pdata->flags & SLOTF_4_BIT_CAPABLE)
- mmc->caps |= MMC_CAP_4_BIT_DATA;
- host->wp_gpio = pdata->wp_gpio;
- }
+ of_property_read_u32(np, "bus-width", &bus_width);
+ if (bus_width == 4)
+ mmc->caps |= MMC_CAP_4_BIT_DATA;
+ else if (bus_width == 8)
+ mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
+ host->wp_gpio = of_get_named_gpio_flags(np, "wp-gpios", 0, &flags);
+
+ if (flags & OF_GPIO_ACTIVE_LOW)
+ host->wp_inverted = 1;
mmc->f_min = 400000;
mmc->f_max = 288000000;
diff --git a/include/linux/mmc/mxs-mmc.h b/include/linux/mmc/mxs-mmc.h
deleted file mode 100644
index 7c2ad3a..0000000
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v2] mmc: mxs-mmc: Remove platform data
2012-10-31 11:22 [PATCH v2] mmc: mxs-mmc: Remove platform data Fabio Estevam
@ 2012-10-31 15:45 ` Shawn Guo
2012-10-31 15:49 ` Fabio Estevam
2012-11-17 20:32 ` Chris Ball
2012-10-31 16:38 ` Marek Vasut
1 sibling, 2 replies; 5+ messages in thread
From: Shawn Guo @ 2012-10-31 15:45 UTC (permalink / raw)
To: Fabio Estevam; +Cc: cjb, marex, linux-mmc, Fabio Estevam
On Wed, Oct 31, 2012 at 09:22:58AM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> All MXS users have been converted to device tree and the board files have been
> removed.
>
> No need to keep platform data in the driver.
>
> Also move bus_width declaration in the beggining of mxs_mmc_probe() to avoid:
> 'warning: ISO C90 forbids mixed declarations and code'.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ----
> Changes since v1:
> - Also remove mxs_mmc_platform_data and linux/mmc/mxs-mmc.h, which was used only
> to include mxs_mmc_platform_data definition.
>
> drivers/mmc/host/mxs-mmc.c | 31 ++++++++++---------------------
> include/linux/mmc/mxs-mmc.h | 19 -------------------
> 2 files changed, 10 insertions(+), 40 deletions(-)
> delete mode 100644 include/linux/mmc/mxs-mmc.h
>
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 80d1e6d..206fe49 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -43,7 +43,6 @@
> #include <linux/module.h>
> #include <linux/pinctrl/consumer.h>
> #include <linux/stmp_device.h>
> -#include <linux/mmc/mxs-mmc.h>
> #include <linux/spi/mxs-spi.h>
>
> #define DRIVER_NAME "mxs-mmc"
> @@ -593,13 +592,13 @@ static int mxs_mmc_probe(struct platform_device *pdev)
> struct mxs_mmc_host *host;
> struct mmc_host *mmc;
> struct resource *iores, *dmares;
> - struct mxs_mmc_platform_data *pdata;
> struct pinctrl *pinctrl;
> int ret = 0, irq_err, irq_dma;
> dma_cap_mask_t mask;
> struct regulator *reg_vmmc;
> enum of_gpio_flags flags;
> struct mxs_ssp *ssp;
> + u32 bus_width = 0;
>
> iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
> @@ -682,25 +681,15 @@ static int mxs_mmc_probe(struct platform_device *pdev)
> mmc->caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED |
> MMC_CAP_SDIO_IRQ | MMC_CAP_NEEDS_POLL;
>
> - pdata = mmc_dev(host->mmc)->platform_data;
> - if (!pdata) {
> - u32 bus_width = 0;
> - of_property_read_u32(np, "bus-width", &bus_width);
> - if (bus_width == 4)
> - mmc->caps |= MMC_CAP_4_BIT_DATA;
> - else if (bus_width == 8)
> - mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
> - host->wp_gpio = of_get_named_gpio_flags(np, "wp-gpios", 0,
> - &flags);
> - if (flags & OF_GPIO_ACTIVE_LOW)
> - host->wp_inverted = 1;
> - } else {
> - if (pdata->flags & SLOTF_8_BIT_CAPABLE)
> - mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
> - if (pdata->flags & SLOTF_4_BIT_CAPABLE)
> - mmc->caps |= MMC_CAP_4_BIT_DATA;
> - host->wp_gpio = pdata->wp_gpio;
> - }
Since you are here, you may also want to remove the "if (np)" check for
non-dt probe case getting devid and dma_channel. As the result,
mxs_ssp_ids can be removed as well.
It could be another patch though, so for this one:
Acked-by: Shawn Guo <shawn.guo@linaro.org>
> + of_property_read_u32(np, "bus-width", &bus_width);
> + if (bus_width == 4)
> + mmc->caps |= MMC_CAP_4_BIT_DATA;
> + else if (bus_width == 8)
> + mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
> + host->wp_gpio = of_get_named_gpio_flags(np, "wp-gpios", 0, &flags);
> +
> + if (flags & OF_GPIO_ACTIVE_LOW)
> + host->wp_inverted = 1;
>
> mmc->f_min = 400000;
> mmc->f_max = 288000000;
> diff --git a/include/linux/mmc/mxs-mmc.h b/include/linux/mmc/mxs-mmc.h
> deleted file mode 100644
> index 7c2ad3a..0000000
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2] mmc: mxs-mmc: Remove platform data
2012-10-31 15:45 ` Shawn Guo
@ 2012-10-31 15:49 ` Fabio Estevam
2012-11-17 20:32 ` Chris Ball
1 sibling, 0 replies; 5+ messages in thread
From: Fabio Estevam @ 2012-10-31 15:49 UTC (permalink / raw)
To: Shawn Guo; +Cc: cjb, marex, linux-mmc, Fabio Estevam
On Wed, Oct 31, 2012 at 1:45 PM, Shawn Guo <shawn.guo@linaro.org> wrote:
> Since you are here, you may also want to remove the "if (np)" check for
> non-dt probe case getting devid and dma_channel. As the result,
> mxs_ssp_ids can be removed as well.
>
> It could be another patch though, so for this one:
>
> Acked-by: Shawn Guo <shawn.guo@linaro.org>
Ok, will do it as a separate patch after this one gets applied.
Regards,
Fabio Estevam
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] mmc: mxs-mmc: Remove platform data
2012-10-31 15:45 ` Shawn Guo
2012-10-31 15:49 ` Fabio Estevam
@ 2012-11-17 20:32 ` Chris Ball
1 sibling, 0 replies; 5+ messages in thread
From: Chris Ball @ 2012-11-17 20:32 UTC (permalink / raw)
To: Shawn Guo; +Cc: Fabio Estevam, marex, linux-mmc, Fabio Estevam
Hi,
On Wed, Oct 31 2012, Shawn Guo wrote:
> On Wed, Oct 31, 2012 at 09:22:58AM -0200, Fabio Estevam wrote:
>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>
>> All MXS users have been converted to device tree and the board files have been
>> removed.
>>
>> No need to keep platform data in the driver.
>>
>> Also move bus_width declaration in the beggining of mxs_mmc_probe() to avoid:
>> 'warning: ISO C90 forbids mixed declarations and code'.
>>
>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Thanks, pushed to mmc-next for 3.8 with ACKs from Marek and Shawn.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] mmc: mxs-mmc: Remove platform data
2012-10-31 11:22 [PATCH v2] mmc: mxs-mmc: Remove platform data Fabio Estevam
2012-10-31 15:45 ` Shawn Guo
@ 2012-10-31 16:38 ` Marek Vasut
1 sibling, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2012-10-31 16:38 UTC (permalink / raw)
To: Fabio Estevam; +Cc: cjb, shawn.guo, linux-mmc, Fabio Estevam
Dear Fabio Estevam,
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> All MXS users have been converted to device tree and the board files have
> been removed.
>
> No need to keep platform data in the driver.
>
> Also move bus_width declaration in the beggining of mxs_mmc_probe() to
> avoid: 'warning: ISO C90 forbids mixed declarations and code'.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
[...]
You might want to do the same for MXS SPI driver.
Acked-by: Marek Vasut <marex@denx.de>
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-11-17 20:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-31 11:22 [PATCH v2] mmc: mxs-mmc: Remove platform data Fabio Estevam
2012-10-31 15:45 ` Shawn Guo
2012-10-31 15:49 ` Fabio Estevam
2012-11-17 20:32 ` Chris Ball
2012-10-31 16:38 ` Marek Vasut
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox