[PATCH V2] fsmc-nand: Add fsmc_nand_set_plat_data in linux/mtd/fsmc.h
Artem Bityutskiy
Artem.Bityutskiy at nokia.com
Fri Feb 25 07:14:19 EST 2011
On Fri, 2011-02-25 at 17:22 +0530, Viresh Kumar wrote:
> +/* 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);
> +
> /* Assert CS signal based on chipnr */
> static void fsmc_select_chip(struct mtd_info *mtd, int chipnr)
> {
> diff --git a/include/linux/mtd/fsmc.h b/include/linux/mtd/fsmc.h
> index 6987995..29e039b 100644
> --- a/include/linux/mtd/fsmc.h
> +++ b/include/linux/mtd/fsmc.h
> @@ -160,4 +160,9 @@ extern void __init fsmc_init_board_info(struct platform_device *pdev,
> struct mtd_partition *partitions, unsigned int nr_partitions,
> unsigned int width);
>
> +/* This function is used to set platform data field of pdev->dev */
Sorry for nit-picking, but having 2 copies of the same comment is prone
to inconsistency :-) I think the general linux way is to put the comment
above the function body and leave the prototype declarations without any
comments.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
More information about the linux-mtd
mailing list