[PATCH v2 44/46] mtd: nandsim: Wire up NANDSIM_IOC_DESTROY_INSTANCE

From: Daniel Walter
Date: Wed Sep 21 2016 - 05:57:39 EST


From: Richard Weinberger <richard@xxxxxx>

The logic for destroying nandsim instances now also ready.

Signed-off-by: Richard Weinberger <richard@xxxxxx>
---
drivers/mtd/nand/nandsim.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index bb30763..5d82a0a 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -2922,6 +2922,19 @@ static long ns_ctrl_ioctl(struct file *file, unsigned int cmd,
ret = ns_ctrl_new_instance(&req, argp + sizeof(req));
break;
}
+ case NANDSIM_IOC_DESTROY_INSTANCE:
+ {
+ struct ns_destroy_instance_req req;
+
+ ret = copy_from_user(&req, argp, sizeof(struct ns_destroy_instance_req));
+ if (ret) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ ret = ns_ctrl_destroy_instance(&req);
+ break;
+ }

default:
ret = -ENOTTY;
--
2.8.3