* [PATCH v4 01/14] mtd: nand: pxa3xx: Remove unneeded ifdef CONFIG_OF [not found] <1376327699-7973-1-git-send-email-ezequiel.garcia@free-electrons.com> @ 2013-08-12 17:14 ` Ezequiel Garcia 2013-08-30 20:06 ` David Woodhouse [not found] ` <1376327699-7973-2-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> 2013-08-12 17:14 ` [PATCH v4 02/14] mtd: nand: pxa3xx: Introduce 'marvell,armada370-nand' compatible string Ezequiel Garcia 1 sibling, 2 replies; 5+ messages in thread From: Ezequiel Garcia @ 2013-08-12 17:14 UTC (permalink / raw) To: linux-mtd Cc: Jason Cooper, Artem Bityutskiy, Brian Norris, Thomas Petazzoni, Lior Amsalem, Gregory Clement, David Woodhouse, Willy Tarreau, Daniel Mack, Ezequiel Garcia, devicetree There's no need to enclose this code within idef CONFIG_OF, because the OF framework provides no-op stubs if CONFIG_OF=n. Cc: devicetree@vger.kernel.org Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> --- drivers/mtd/nand/pxa3xx_nand.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 501e380..02f214d 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1190,7 +1190,6 @@ static int pxa3xx_nand_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_OF static struct of_device_id pxa3xx_nand_dt_ids[] = { { .compatible = "marvell,pxa3xx-nand" }, {} @@ -1221,12 +1220,6 @@ static int pxa3xx_nand_probe_dt(struct platform_device *pdev) return 0; } -#else -static inline int pxa3xx_nand_probe_dt(struct platform_device *pdev) -{ - return 0; -} -#endif static int pxa3xx_nand_probe(struct platform_device *pdev) { -- 1.8.1.5 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v4 01/14] mtd: nand: pxa3xx: Remove unneeded ifdef CONFIG_OF 2013-08-12 17:14 ` [PATCH v4 01/14] mtd: nand: pxa3xx: Remove unneeded ifdef CONFIG_OF Ezequiel Garcia @ 2013-08-30 20:06 ` David Woodhouse 2013-08-31 16:53 ` Ezequiel Garcia [not found] ` <1376327699-7973-2-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> 1 sibling, 1 reply; 5+ messages in thread From: David Woodhouse @ 2013-08-30 20:06 UTC (permalink / raw) To: Ezequiel Garcia Cc: Thomas Petazzoni, Lior Amsalem, Jason Cooper, Artem Bityutskiy, Daniel Mack, devicetree, linux-mtd, Gregory Clement, Brian Norris, Willy Tarreau [-- Attachment #1.1: Type: text/plain, Size: 362 bytes --] On Mon, 2013-08-12 at 14:14 -0300, Ezequiel Garcia wrote: > There's no need to enclose this code within idef CONFIG_OF, > because the OF framework provides no-op stubs if CONFIG_OF=n. Hm, won't this end up with the same 'pxa3xx_nand_dt_ids is defined but not used' warning that just caused us to *add* an #ifdef CONFIG_OF to atmel_nand? -- dwmw2 [-- Attachment #1.2: smime.p7s --] [-- Type: application/x-pkcs7-signature, Size: 5745 bytes --] [-- Attachment #2: Type: text/plain, Size: 144 bytes --] ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v4 01/14] mtd: nand: pxa3xx: Remove unneeded ifdef CONFIG_OF 2013-08-30 20:06 ` David Woodhouse @ 2013-08-31 16:53 ` Ezequiel Garcia 0 siblings, 0 replies; 5+ messages in thread From: Ezequiel Garcia @ 2013-08-31 16:53 UTC (permalink / raw) To: David Woodhouse Cc: Thomas Petazzoni, Lior Amsalem, Jason Cooper, Artem Bityutskiy, Daniel Mack, devicetree, linux-mtd, Gregory Clement, Brian Norris, Willy Tarreau On Fri, Aug 30, 2013 at 09:06:22PM +0100, David Woodhouse wrote: > On Mon, 2013-08-12 at 14:14 -0300, Ezequiel Garcia wrote: > > There's no need to enclose this code within idef CONFIG_OF, > > because the OF framework provides no-op stubs if CONFIG_OF=n. > > Hm, won't this end up with the same 'pxa3xx_nand_dt_ids is defined but > not used' warning that just caused us to *add* an #ifdef CONFIG_OF to > atmel_nand? > No, it won't. Currently atmel_nand uses its of_device_id for just the of_match_table, while pxa3xx-nand uses the pxa3xx_nand_dt_ids for more than just that, as a paramater for of_match_device(). The latter prevents the warning by having an actual dummy-inlined implementation for the !OF case. I'll answer about the atmel_nand in the respective patch. -- Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <1376327699-7973-2-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>]
* Re: [PATCH v4 01/14] mtd: nand: pxa3xx: Remove unneeded ifdef CONFIG_OF [not found] ` <1376327699-7973-2-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> @ 2013-09-16 22:57 ` Olof Johansson 0 siblings, 0 replies; 5+ messages in thread From: Olof Johansson @ 2013-09-16 22:57 UTC (permalink / raw) To: Ezequiel Garcia Cc: linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Jason Cooper, Artem Bityutskiy, Brian Norris, Thomas Petazzoni, Lior Amsalem, Gregory Clement, David Woodhouse, Willy Tarreau, Daniel Mack, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Mon, Aug 12, 2013 at 10:14 AM, Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote: > There's no need to enclose this code within idef CONFIG_OF, > because the OF framework provides no-op stubs if CONFIG_OF=n. > > Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> I've applied this to arm-soc fixes (with Brian's signed-off inbetween, since I picked it up from linux-next by cherry-pick). Based on other discussions, David is MIA and this patch is needed to fix pxa3xx builds. -Olof -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v4 02/14] mtd: nand: pxa3xx: Introduce 'marvell,armada370-nand' compatible string [not found] <1376327699-7973-1-git-send-email-ezequiel.garcia@free-electrons.com> 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 1 sibling, 0 replies; 5+ messages in thread From: Ezequiel Garcia @ 2013-08-12 17:14 UTC (permalink / raw) To: linux-mtd Cc: Jason Cooper, Artem Bityutskiy, Brian Norris, Thomas Petazzoni, Lior Amsalem, Gregory Clement, David Woodhouse, Willy Tarreau, Daniel Mack, Ezequiel Garcia, devicetree This driver supports NFCv1 (as found in PXA SoC) and NFCv2 (as found in Armada 370/XP SoC). As both controller has a few differences, a way of distinguishing between the two is needed. This commit introduces a new compatible string 'marvell,armada370-nand' and assigns a compatible data of type enum pxa3xx_nand_variant to allow such distinction. Cc: devicetree@vger.kernel.org Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> --- drivers/mtd/nand/pxa3xx_nand.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 02f214d..55eb153 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -123,6 +123,11 @@ enum { STATE_READY, }; +enum pxa3xx_nand_variant { + PXA3XX_NAND_VARIANT_PXA, + PXA3XX_NAND_VARIANT_ARMADA370, +}; + struct pxa3xx_nand_host { struct nand_chip chip; struct pxa3xx_nand_cmdset *cmdset; @@ -171,6 +176,12 @@ struct pxa3xx_nand_info { struct pxa3xx_nand_host *host[NUM_CHIP_SELECT]; unsigned int state; + /* + * This driver supports NFCv1 (as found in PXA SoC) + * and NFCv2 (as found in Armada 370/XP SoC). + */ + enum pxa3xx_nand_variant variant; + int cs; int use_ecc; /* use HW ECC ? */ int use_dma; /* use DMA ? */ @@ -1191,11 +1202,28 @@ static int pxa3xx_nand_remove(struct platform_device *pdev) } static struct of_device_id pxa3xx_nand_dt_ids[] = { - { .compatible = "marvell,pxa3xx-nand" }, + { + .compatible = "marvell,pxa3xx-nand", + .data = (void *) PXA3XX_NAND_VARIANT_PXA, + }, + { + .compatible = "marvell,armada370-nand", + .data = (void *) PXA3XX_NAND_VARIANT_ARMADA370, + }, {} }; MODULE_DEVICE_TABLE(of, pxa3xx_nand_dt_ids); +static enum pxa3xx_nand_variant +pxa3xx_nand_get_variant(struct platform_device *pdev) +{ + const struct of_device_id *of_id = + of_match_device(pxa3xx_nand_dt_ids, &pdev->dev); + if (!of_id) + return PXA3XX_NAND_VARIANT_PXA; + return (enum pxa3xx_nand_variant) of_id->data; +} + static int pxa3xx_nand_probe_dt(struct platform_device *pdev) { struct pxa3xx_nand_platform_data *pdata; @@ -1245,6 +1273,7 @@ static int pxa3xx_nand_probe(struct platform_device *pdev) } info = platform_get_drvdata(pdev); + info->variant = pxa3xx_nand_get_variant(pdev); probe_success = 0; for (cs = 0; cs < pdata->num_cs; cs++) { info->cs = cs; -- 1.8.1.5 ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-09-16 22:57 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1376327699-7973-1-git-send-email-ezequiel.garcia@free-electrons.com> 2013-08-12 17:14 ` [PATCH v4 01/14] mtd: nand: pxa3xx: Remove unneeded ifdef CONFIG_OF Ezequiel Garcia 2013-08-30 20:06 ` David Woodhouse 2013-08-31 16:53 ` Ezequiel Garcia [not found] ` <1376327699-7973-2-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> 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
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).