summaryrefslogtreecommitdiff
path: root/ubi-utils/include/libubi.h
diff options
context:
space:
mode:
authorRichard Genoud <richard.genoud@gmail.com>2012-08-22 18:04:37 +0200
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-08-23 12:48:54 +0300
commit9d8751b3f5c6358b6167c38899f1e41498d24a45 (patch)
treedb952e5015e6f33a2e93e3cf477227ea5d52dfc9 /ubi-utils/include/libubi.h
parent878e06ea555ba5dbfb974b3904d1a86a9a0e20f5 (diff)
ubiattach: fail if kernel ignores max_beb_per1024
If the kernel doesn't know the max_beb_per1024 parameter in the attach ioctl, but the call still succeeded ubi_attach and ubi_attach_mtd will return 1 instead of 0. In this case, the ubiattach command will detach the device and fail with an error message. Signed-off-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'ubi-utils/include/libubi.h')
-rw-r--r--ubi-utils/include/libubi.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/ubi-utils/include/libubi.h b/ubi-utils/include/libubi.h
index 84ac84c..47f40e2 100644
--- a/ubi-utils/include/libubi.h
+++ b/ubi-utils/include/libubi.h
@@ -221,12 +221,14 @@ int mtd_num2ubi_dev(libubi_t desc, int mtd_num, int *dev_num);
* @req. If @req->mtd_dev_node is given it should contain path to the MTD
* device node. Otherwise @req->mtd_num will be used.
*
- * Returns %0 in case of success and %-1 in case of failure (errno is set).
- * The newly created UBI device number is returned in @req->dev_num.
- * The MTD device number is returned in @req->mtd_num (-1 if not found)
+ * Returns %0 in case of success, %-1 in case of failure (errno is set) and %1
+ * if parameter @req->max_beb_per1024 was ignored by kernel (because the kernel
+ * is old and does not support this feature, which was added in 3.7). The newly
+ * created UBI device number is returned in @req->dev_num. In the MTD device
+ * was specified by its device node path, the MTD device number is returned in
+ * @req->mtd_num.
*/
-int ubi_attach(libubi_t desc, const char *node,
- struct ubi_attach_request *req);
+int ubi_attach(libubi_t desc, const char *node, struct ubi_attach_request *req);
/**
* ubi_detach_mtd - detach an MTD device.