From: Sascha Hauer <s.hauer@pengutronix.de>
To: Fabio Estevam <festevam@gmail.com>
Cc: linux-mtd@lists.infradead.org, kernel@pengutronix.de,
miquel.raynal@bootlin.com
Subject: Re: [PATCH] mtd: rawnand: mxc: Remove platform data support
Date: Tue, 10 Nov 2020 09:00:52 +0100 [thread overview]
Message-ID: <20201110080052.GN29830@pengutronix.de> (raw)
In-Reply-To: <20201110002807.7072-1-festevam@gmail.com>
Hi Fabio,
On Mon, Nov 09, 2020 at 09:28:07PM -0300, Fabio Estevam wrote:
> i.MX is a devicetree-only platform now and the existing platform data
> support in this driver was only useful for old non-devicetree platforms.
>
> Get rid of the platform data support since it is no longer used.
What about
static const struct platform_device_id mxcnd_devtype[] = {
...
};
This is unused now as well.
Also the #ifdef CONFIG_OF seem unnecessary now when it's the only way to
probe this driver.
>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
> drivers/mtd/nand/raw/mxc_nand.c | 25 +---------------------
> include/linux/platform_data/mtd-mxc_nand.h | 19 ----------------
> 2 files changed, 1 insertion(+), 43 deletions(-)
> delete mode 100644 include/linux/platform_data/mtd-mxc_nand.h
>
> diff --git a/drivers/mtd/nand/raw/mxc_nand.c b/drivers/mtd/nand/raw/mxc_nand.c
> index 684c51e5e60d..e38c84e1c76d 100644
> --- a/drivers/mtd/nand/raw/mxc_nand.c
> +++ b/drivers/mtd/nand/raw/mxc_nand.c
> @@ -21,7 +21,6 @@
> #include <linux/completion.h>
> #include <linux/of.h>
> #include <linux/of_device.h>
> -#include <linux/platform_data/mtd-mxc_nand.h>
>
> #define DRIVER_NAME "mxc_nand"
>
> @@ -184,7 +183,6 @@ struct mxc_nand_host {
> unsigned int buf_start;
>
> const struct mxc_nand_devtype_data *devtype_data;
> - struct mxc_nand_platform_data pdata;
> };
>
> static const char * const part_probes[] = {
> @@ -1801,17 +1799,6 @@ static int mxcnd_probe(struct platform_device *pdev)
> return PTR_ERR(host->clk);
>
> err = mxcnd_probe_dt(host);
> - if (err > 0) {
> - struct mxc_nand_platform_data *pdata =
> - dev_get_platdata(&pdev->dev);
> - if (pdata) {
> - host->pdata = *pdata;
> - host->devtype_data = (struct mxc_nand_devtype_data *)
> - pdev->id_entry->driver_data;
> - } else {
> - err = -ENODEV;
> - }
> - }
> if (err < 0)
> return err;
mxcnd_probe_dt() can still return values > 0 in which case you should
return an error from probe. I think this code path should be cleaned up
a bit. Maybe you can inline mxcnd_probe_dt() here.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2020-11-10 8:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-10 0:28 [PATCH] mtd: rawnand: mxc: Remove platform data support Fabio Estevam
2020-11-10 8:00 ` Sascha Hauer [this message]
2020-11-10 12:20 ` Fabio Estevam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201110080052.GN29830@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox