From: Artem Bityutskiy <dedekind1@gmail.com>
To: Jamie Iles <jamie@jamieiles.com>
Cc: Scott Wood <scottwood@freescale.com>,
David Woodhouse <dwmw2@infradead.org>,
devicetree-discuss@lists.ozlabs.org,
linux-mtd@lists.infradead.org,
Grant Likely <grant.likely@secretlab.ca>
Subject: Re: [PATCHv4] mtd: gpio-nand: add device tree bindings
Date: Mon, 15 Aug 2011 17:28:57 +0300 [thread overview]
Message-ID: <1313418543.2600.2.camel@sauron> (raw)
In-Reply-To: <1312902747-21372-1-git-send-email-jamie@jamieiles.com>
On Tue, 2011-08-09 at 16:12 +0100, Jamie Iles wrote:
> - res1 = platform_get_resource(dev, IORESOURCE_MEM, 1);
> + if (!dev->dev.of_node)
> + res1 = platform_get_resource(dev, IORESOURCE_MEM, 1);
> + else
> + res1 = gpio_nand_of_get_io_sync(&dev->dev);
> +
> if (res1) {
> gpiomtd->io_sync = request_and_remap(res1, 4, "NAND sync", &ret);
> if (!gpiomtd->io_sync) {
> @@ -257,7 +362,16 @@ static int __devinit gpio_nand_probe(struct platform_device *dev)
> }
> }
>
> - memcpy(&gpiomtd->plat, dev->dev.platform_data, sizeof(gpiomtd->plat));
> + if (dev->dev.of_node)
> + kfree(res1);
> +
> + if (dev->dev.platform_data)
> + memcpy(&gpiomtd->plat, dev->dev.platform_data,
> + sizeof(gpiomtd->plat));
> + else
> + ret = gpio_nand_of_get_config(&dev->dev, &gpiomtd->plat);
> + if (ret)
> + goto err_nce;
>
So with this code you can mix platform data and DT? Say, io_sync may
come from platform data and the rest from the DT? Is this normal
practice?
--
Best Regards,
Artem Bityutskiy
WARNING: multiple messages have this Message-ID (diff)
From: Artem Bityutskiy <dedekind1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jamie Iles <jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>
Cc: Scott Wood <scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCHv4] mtd: gpio-nand: add device tree bindings
Date: Mon, 15 Aug 2011 17:28:57 +0300 [thread overview]
Message-ID: <1313418543.2600.2.camel@sauron> (raw)
In-Reply-To: <1312902747-21372-1-git-send-email-jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>
On Tue, 2011-08-09 at 16:12 +0100, Jamie Iles wrote:
> - res1 = platform_get_resource(dev, IORESOURCE_MEM, 1);
> + if (!dev->dev.of_node)
> + res1 = platform_get_resource(dev, IORESOURCE_MEM, 1);
> + else
> + res1 = gpio_nand_of_get_io_sync(&dev->dev);
> +
> if (res1) {
> gpiomtd->io_sync = request_and_remap(res1, 4, "NAND sync", &ret);
> if (!gpiomtd->io_sync) {
> @@ -257,7 +362,16 @@ static int __devinit gpio_nand_probe(struct platform_device *dev)
> }
> }
>
> - memcpy(&gpiomtd->plat, dev->dev.platform_data, sizeof(gpiomtd->plat));
> + if (dev->dev.of_node)
> + kfree(res1);
> +
> + if (dev->dev.platform_data)
> + memcpy(&gpiomtd->plat, dev->dev.platform_data,
> + sizeof(gpiomtd->plat));
> + else
> + ret = gpio_nand_of_get_config(&dev->dev, &gpiomtd->plat);
> + if (ret)
> + goto err_nce;
>
So with this code you can mix platform data and DT? Say, io_sync may
come from platform data and the rest from the DT? Is this normal
practice?
--
Best Regards,
Artem Bityutskiy
next prev parent reply other threads:[~2011-08-15 14:27 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-09 15:12 [PATCHv4] mtd: gpio-nand: add device tree bindings Jamie Iles
2011-08-09 15:12 ` Jamie Iles
2011-08-10 15:13 ` Scott Wood
2011-08-10 15:13 ` Scott Wood
2011-08-11 9:00 ` Jamie Iles
2011-08-11 9:00 ` Jamie Iles
2011-08-15 13:57 ` Artem Bityutskiy
2011-08-15 13:57 ` Artem Bityutskiy
2011-08-15 13:58 ` Jamie Iles
2011-08-15 13:58 ` Jamie Iles
2011-08-15 14:28 ` Artem Bityutskiy [this message]
2011-08-15 14:28 ` Artem Bityutskiy
2011-08-15 14:38 ` Jamie Iles
2011-08-15 14:38 ` Jamie Iles
2011-08-15 14:45 ` Artem Bityutskiy
2011-08-15 14:45 ` Artem Bityutskiy
2011-08-15 15:24 ` Jamie Iles
2011-08-15 15:24 ` Jamie Iles
2011-08-19 19:51 ` Artem Bityutskiy
2011-08-19 19:51 ` Artem Bityutskiy
2011-08-19 21:18 ` Jamie Iles
2011-08-19 21:18 ` Jamie Iles
2011-08-20 3:39 ` Artem Bityutskiy
2011-08-20 3:39 ` Artem Bityutskiy
2011-08-20 6:38 ` Jamie Iles
2011-08-20 6:38 ` Jamie Iles
2011-08-20 12:09 ` Artem Bityutskiy
2011-08-20 12:09 ` Artem Bityutskiy
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=1313418543.2600.2.camel@sauron \
--to=dedekind1@gmail.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=dwmw2@infradead.org \
--cc=grant.likely@secretlab.ca \
--cc=jamie@jamieiles.com \
--cc=linux-mtd@lists.infradead.org \
--cc=scottwood@freescale.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.