[PATCH V2 resend] fsmc-nand: Add fsmc_nand_set_plat_data in drivers/mtd/nand/fsmc_nand.c

Artem Bityutskiy dedekind1 at gmail.com
Tue Mar 1 00:51:01 EST 2011


On Tue, 2011-03-01 at 09:22 +0530, viresh kumar wrote:
> This is what i explained in the commit message also. We don't declare device
> structures in board files, as this information is machine dependent, so this is present
> in common machine file to all boards.

> Now we have to set platform data. This can be be done in board_init() routine in
> the board specific file.

>  But then this routine will contain below mentioned code,
> and so will not look clean enough.

Not sure why it will be not clean enough. Just add it to your board
files, this is few lines of code after all.

if (partitions) {
	plat_data->partitions = partitions;
	plat_data->nr_partitions = nr_partitions;
}
plat_data->options = options;
plat_data->width = width;

How many board files you have?

>  so we thought of creating this function which can
> simply be reused by all board files.

OK, but I think you should try to find some other place instead of
putting it to the driver. What is the fundamental reason to put this
code to the driver? Why it belongs to the driver?

-- 
Best Regards,
Artem Bityutskiy (Битюцкий Артём)




More information about the linux-mtd mailing list