Beispiel #1
0
int ubi_get_dev_info(libubi_t desc, const char *node, struct ubi_dev_info *info)
{
	int dev_num;
	struct libubi *lib = (struct libubi *)desc;

	if (dev_node2num(lib, node, &dev_num))
		return -1;

	return ubi_get_dev_info1(desc, dev_num, info);
}
int mtd_get_dev_info(libmtd_t desc, const char *node, struct mtd_dev_info *mtd)
{
	int dev_num;
	struct libmtd *lib = (struct libmtd *)desc;

	if (!lib->sysfs_supported)
		return legacy_get_dev_info(node, mtd);

	if (dev_node2num(lib, node, &dev_num))
		return -1;

	return mtd_get_dev_info1(desc, dev_num, mtd);
}
Beispiel #3
0
int ubi_get_dev_info(libubi_t desc, const char *node, struct ubi_dev_info *info)
{
	int err, dev_num;
	struct libubi *lib = (struct libubi *)desc;

	err = ubi_probe_node(desc, node);
	if (err != 1) {
		if (err == 2)
			errno = ENODEV;
		return -1;
	}

	if (dev_node2num(lib, node, &dev_num))
		return -1;

	return ubi_get_dev_info1(desc, dev_num, info);
}