[PATCH 3/6] mtd: nand: bb: use mtd api directly

Alexander Aring alex.aring at gmail.com
Mon Apr 28 06:05:26 PDT 2014


Hi Sascha,

On Mon, Apr 28, 2014 at 11:49:36AM +0200, Sascha Hauer wrote:
> The devfs layer just adds an addition indirection between mtd
> and the bb devices with no purpose. Drop it.
> 
> Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
> ---
>  drivers/mtd/nand/nand-bb.c | 122 +++++++++++++++++++--------------------------
>  1 file changed, 50 insertions(+), 72 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand-bb.c b/drivers/mtd/nand/nand-bb.c
> index f387ef6..06b5824 100644
> --- a/drivers/mtd/nand/nand-bb.c
> +++ b/drivers/mtd/nand/nand-bb.c
> @@ -25,22 +25,18 @@
>  #include <init.h>
>  #include <ioctl.h>
>  #include <nand.h>
> -#include <linux/mtd/mtd-abi.h>
> +#include <linux/mtd/mtd.h>
>  #include <fcntl.h>
>  #include <libgen.h>
...

> @@ -313,8 +291,8 @@ int dev_remove_bb_dev(const char *name)
>  	list_for_each_entry(bb, &bb_list, list) {
>  		if (!strcmp(bb->cdev.name, name)) {
>  			devfs_remove(&bb->cdev);
> -			cdev_close(bb->cdev_parent);
>  			list_del_init(&bb->list);
> +			free(bb->name);
>  			free(bb);
>  			return 0;
>  		}

I know you doesn't change this line but I think we need a
list_for_each_entry_safe here instead of list_for_each_entry.

- Alex



More information about the barebox mailing list