[PATCH 4/4] mtd: ubi: remove now unused ioctls
Sascha Hauer
s.hauer at pengutronix.de
Thu Sep 22 00:49:26 PDT 2016
The only ioctl needed is the one to get the ubi_num from a file
descriptor. The remaining ioctls are now implemented as regular
function calls.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/mtd/ubi/barebox.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/drivers/mtd/ubi/barebox.c b/drivers/mtd/ubi/barebox.c
index cb9223e..23c4bfd 100644
--- a/drivers/mtd/ubi/barebox.c
+++ b/drivers/mtd/ubi/barebox.c
@@ -282,23 +282,14 @@ int ubi_api_remove_volume(struct ubi_volume_desc *desc, int no_vtbl)
static int ubi_cdev_ioctl(struct cdev *cdev, int cmd, void *buf)
{
- struct ubi_volume_desc *desc;
struct ubi_device *ubi = cdev->priv;
- struct ubi_mkvol_req *req = buf;
switch (cmd) {
- case UBI_IOCRMVOL:
- desc = ubi_open_volume_nm(ubi->ubi_num, req->name,
- UBI_EXCLUSIVE);
- if (IS_ERR(desc))
- return PTR_ERR(desc);
- ubi_remove_volume(desc, 0);
- ubi_close_volume(desc);
- break;
- case UBI_IOCMKVOL:
- if (!req->bytes)
- req->bytes = (__s64)ubi->avail_pebs * ubi->leb_size;
- return ubi_create_volume(ubi, req);
+ /*
+ * Only supported ioctl is a barebox specific one to get the ubi_num
+ * from the file descriptor. The rest is implemented as function calls
+ * directly.
+ */
case UBI_IOCGETUBINUM:
*(u32 *)buf = ubi->ubi_num;
break;
--
2.8.1
More information about the barebox
mailing list