summaryrefslogtreecommitdiffstats
path: root/commands/nand.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-09-10 12:06:43 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2009-09-11 09:13:28 +0200
commit2ee3e596c5dfc56baca440faed47bc641719d26b (patch)
treedfd430f05104b123f4cbf2ec2965c5ba3c8bcf0d /commands/nand.c
parent33a6b5abcac2a981fcd38d973951015d9db11bee (diff)
downloadbarebox-2ee3e596c5dfc56baca440faed47bc641719d26b.tar.gz
nand bb: fix removal of bb devices
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/nand.c')
-rw-r--r--commands/nand.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/commands/nand.c b/commands/nand.c
index 3f8516e..d6a15a3 100644
--- a/commands/nand.c
+++ b/commands/nand.c
@@ -267,7 +267,6 @@ free_out:
static int do_nand(cmd_tbl_t *cmdtp, int argc, char *argv[])
{
int opt;
- struct device_d *dev;
struct nand_bb *bb;
int command = 0, badblock = 0;
@@ -304,16 +303,15 @@ static int do_nand(cmd_tbl_t *cmdtp, int argc, char *argv[])
if (command & NAND_DEL) {
while (optind < argc) {
struct cdev *cdev;
+
cdev = cdev_by_name(basename(argv[optind]));
if (!cdev) {
printf("no such device: %s\n", argv[optind]);
return 1;
}
- dev = cdev->dev;
-
- bb = dev->priv;
+ bb = cdev->priv;
close(bb->fd);
- unregister_device(dev);
+ devfs_remove(cdev);
free(bb);
optind++;
}