From: Brian Norris <computersforpeace@gmail.com>
To: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
Lior Amsalem <alior@marvell.com>,
Jason Cooper <jason@lakedaemon.net>,
Artem Bityutskiy <dedekind1@gmail.com>,
Daniel Mack <zonque@gmail.com>,
linux-mtd@lists.infradead.org,
Gregory Clement <gregory.clement@free-electrons.com>,
David Woodhouse <dwmw2@infradead.org>, Willy Tarreau <w@1wt.eu>
Subject: Re: [PATCH v4 08/14] mtd: nand: pxa3xx: Remove hardcoded mtd name
Date: Mon, 12 Aug 2013 16:18:50 -0700 [thread overview]
Message-ID: <20130812231850.GA7267@brian-ubuntu> (raw)
In-Reply-To: <1376327699-7973-9-git-send-email-ezequiel.garcia@free-electrons.com>
On Mon, Aug 12, 2013 at 02:14:53PM -0300, Ezequiel Garcia wrote:
> There's no advantage in using a hardcoded name for the mtd device.
> Instead use the provided by the platform_device.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> Tested-by: Daniel Mack <zonque@gmail.com>
> ---
> drivers/mtd/nand/pxa3xx_nand.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
> index 17a3e2c..5bbb8b8 100644
> --- a/drivers/mtd/nand/pxa3xx_nand.c
> +++ b/drivers/mtd/nand/pxa3xx_nand.c
> @@ -244,8 +244,6 @@ static struct pxa3xx_nand_flash builtin_flash_types[] = {
> /* Define a default flash type setting serve as flash detecting only */
> #define DEFAULT_FLASH_TYPE (&builtin_flash_types[0])
>
> -const char *mtd_names[] = {"pxa3xx_nand-0", "pxa3xx_nand-1", NULL};
> -
> #define NDTR0_tCH(c) (min((c), 7) << 19)
> #define NDTR0_tCS(c) (min((c), 7) << 16)
> #define NDTR0_tWH(c) (min((c), 7) << 11)
> @@ -1091,8 +1089,6 @@ KEEP_CONFIG:
> host->row_addr_cycles = 3;
> else
> host->row_addr_cycles = 2;
> -
> - mtd->name = mtd_names[0];
> return nand_scan_tail(mtd);
> }
>
> @@ -1314,6 +1310,8 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
> probe_success = 0;
> for (cs = 0; cs < pdata->num_cs; cs++) {
> struct mtd_info *mtd = info->host[cs]->mtd;
> +
> + mtd->name = pdev->name;
I notice a potential improvement here: use dev_name(&pdev->dev) instead of
pdev->name. There is slight difference between the two, I think, where
dev_name() will have automatically append an index suffix (i.e.,
"pxa3xx-nand.0") whereas pdev->name may just be "pxa3xx-nand".
If that tests out fine for you, just submit a follow-up patch. Or maybe I'm
wrong about pdev->name vs. dev_name(). Either way, it's not worth a series
resend.
> info->cs = cs;
> ret = pxa3xx_nand_scan(mtd);
> if (ret) {
Thanks,
Brian
next prev parent reply other threads:[~2013-08-12 23:19 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-12 17:14 [PATCH v4 00/14] pxa3xx-nand patches to support mvebu builds Ezequiel Garcia
2013-08-12 17:14 ` [PATCH v4 01/14] mtd: nand: pxa3xx: Remove unneeded ifdef CONFIG_OF Ezequiel Garcia
2013-08-12 17:14 ` Ezequiel Garcia
2013-08-30 20:06 ` David Woodhouse
2013-08-30 20:06 ` David Woodhouse
2013-08-31 16:53 ` Ezequiel Garcia
2013-08-31 16:53 ` Ezequiel Garcia
2013-09-16 22:57 ` Olof Johansson
2013-09-16 22:57 ` Olof Johansson
2013-08-12 17:14 ` [PATCH v4 02/14] mtd: nand: pxa3xx: Introduce 'marvell, armada370-nand' compatible string Ezequiel Garcia
2013-08-12 17:14 ` [PATCH v4 02/14] mtd: nand: pxa3xx: Introduce 'marvell,armada370-nand' " Ezequiel Garcia
2013-08-12 17:14 ` [PATCH v4 03/14] mtd: nand: pxa3xx: Handle ECC and DMA enable/disable properly Ezequiel Garcia
2013-08-12 17:14 ` [PATCH v4 04/14] mtd: nand: pxa3xx: Allow to set/clear the 'spare enable' field Ezequiel Garcia
2013-08-12 17:14 ` [PATCH v4 05/14] mtd: nand: pxa3xx: Support command buffer #3 Ezequiel Garcia
2013-08-12 17:14 ` [PATCH v4 06/14] mtd: nand: pxa3xx: Use 'length override' in ONFI paramater page read Ezequiel Garcia
2013-08-12 17:14 ` [PATCH v4 07/14] mtd: nand: pxa3xx: Add a local loop variable Ezequiel Garcia
2013-08-12 17:14 ` [PATCH v4 08/14] mtd: nand: pxa3xx: Remove hardcoded mtd name Ezequiel Garcia
2013-08-12 23:18 ` Brian Norris [this message]
2013-08-12 17:14 ` [PATCH v4 09/14] mtd: nand: pxa3xx: Remove uneeded internal cmdset Ezequiel Garcia
2013-08-12 17:14 ` [PATCH v4 10/14] mtd: nand: pxa3xx: Move cached registers to info structure Ezequiel Garcia
2013-08-12 17:14 ` [PATCH v4 11/14] mtd: nand: pxa3xx: Make dma code dependent on dma capable platforms Ezequiel Garcia
2013-08-12 17:14 ` [PATCH v4 12/14] mtd: nand: pxa3xx: Add __maybe_unused keyword to enable_int() Ezequiel Garcia
2013-08-12 17:14 ` [PATCH v4 13/14] mtd: nand: pxa3xx: Allow devices with no dma resources Ezequiel Garcia
2013-08-12 17:14 ` [PATCH v4 14/14] mtd: nand: Allow to build pxa3xx_nand on Orion platforms Ezequiel Garcia
2013-08-12 23:19 ` [PATCH v4 00/14] pxa3xx-nand patches to support mvebu builds Brian Norris
2013-08-13 11:37 ` Ezequiel Garcia
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=20130812231850.GA7267@brian-ubuntu \
--to=computersforpeace@gmail.com \
--cc=alior@marvell.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=ezequiel.garcia@free-electrons.com \
--cc=gregory.clement@free-electrons.com \
--cc=jason@lakedaemon.net \
--cc=linux-mtd@lists.infradead.org \
--cc=thomas.petazzoni@free-electrons.com \
--cc=w@1wt.eu \
--cc=zonque@gmail.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 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.