From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
To: Viresh Kumar <viresh.kumar@st.com>
Cc: Vipin Kumar <vipin.kumar@st.com>,
linux-mtd@lists.infradead.org, dwmw2@infradead.org,
linus.walleij@stericsson.com
Subject: Re: [PATCH V2 resend] fsmc-nand: Add fsmc_nand_set_plat_data in drivers/mtd/nand/fsmc_nand.c
Date: Mon, 28 Feb 2011 14:51:18 +0200 [thread overview]
Message-ID: <1298897478.2809.12.camel@localhost> (raw)
In-Reply-To: <8b8879499520ac641f7e38ac0e40182eb7f32f85.1298866118.git.viresh.kumar@st.com>
On Mon, 2011-02-28 at 09:39 +0530, Viresh Kumar wrote:
> In most of the cases partitions info, width, etc comes from board files. And
> device structure may be defined in machine files, common to all board files.
> Thus, we need to set platform data from board file, for which
> fsmc_nand_set_plat_data routine is required.
Hi, sorry, but after looking a bit closer I do not see why you need this
function.
Why could not you set up the width, options, and partitions in the
straight in board file, e.g., like arch/arm/mach-omap2/board-igep0030.c
sets partitions for onenand driver? Also, for partitions you can use
command line arguments, like this is done in
drivers/mtd/onenand/generic.c
> +/* This function is used to set platform data field of pdev->dev */
> +void fsmc_nand_set_plat_data(struct platform_device *pdev,
> + struct mtd_partition *partitions, unsigned int nr_partitions,
> + unsigned int options, unsigned int width)
> +{
> + struct fsmc_nand_platform_data *plat_data;
> + plat_data = dev_get_platdata(&pdev->dev);
> +
> + if (partitions) {
> + plat_data->partitions = partitions;
> + plat_data->nr_partitions = nr_partitions;
> + }
> +
> + plat_data->options = options;
> + plat_data->width = width;
> +}
> +EXPORT_SYMBOL_GPL(fsmc_nand_set_plat_data);
Just looks a bit too much to add a function which simply assigns
parameters and then export it. If you'll need to initialize more
parameters later, will you add more arguments there?
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
next prev parent reply other threads:[~2011-02-28 12:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-28 4:09 [PATCH V2 resend] fsmc-nand: Add fsmc_nand_set_plat_data in drivers/mtd/nand/fsmc_nand.c Viresh Kumar
2011-02-28 12:51 ` Artem Bityutskiy [this message]
2011-03-01 3:52 ` viresh kumar
2011-03-01 4:07 ` viresh kumar
2011-03-01 5:51 ` Artem Bityutskiy
2011-03-01 6:04 ` viresh kumar
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=1298897478.2809.12.camel@localhost \
--to=artem.bityutskiy@nokia.com \
--cc=dwmw2@infradead.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-mtd@lists.infradead.org \
--cc=vipin.kumar@st.com \
--cc=viresh.kumar@st.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.