Lines Matching refs:ubi_num

58 	int ubi_num;
246 * @ubi_num: UBI device number
249 * @ubi_num, or %NULL if the device does not exist. This function increases the
253 struct ubi_device *ubi_get_device(int ubi_num)
258 ubi = ubi_devices[ubi_num];
319 int i, ubi_num = -ENODEV;
326 ubi_num = ubi->ubi_num;
332 return ubi_num;
350 * we still can use 'ubi->ubi_num'.
437 sprintf(ubi->ubi_name, UBI_NAME_STR "%d", ubi->ubi_num);
460 dev_set_name(&ubi->dev, UBI_NAME_STR "%d", ubi->ubi_num);
824 * @ubi_num: number to assign to the new UBI device
828 * This function attaches MTD device @mtd_dev to UBI and assign @ubi_num number
829 * to the newly created UBI device, unless @ubi_num is %UBI_DEV_NUM_AUTO, in
837 int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
899 if (ubi_num == UBI_DEV_NUM_AUTO) {
901 for (ubi_num = 0; ubi_num < UBI_MAX_DEVICES; ubi_num++)
902 if (!ubi_devices[ubi_num])
904 if (ubi_num == UBI_MAX_DEVICES) {
910 if (ubi_num >= UBI_MAX_DEVICES)
913 /* Make sure ubi_num is not busy */
914 if (ubi_devices[ubi_num]) {
915 pr_err("ubi: ubi%i already exists\n", ubi_num);
930 ubi->ubi_num = ubi_num;
1046 ubi_devices[ubi_num] = ubi;
1048 return ubi_num;
1067 * @ubi_num: UBI device number to detach from
1070 * This function destroys an UBI device number @ubi_num and detaches the
1078 int ubi_detach_mtd_dev(int ubi_num, int anyway)
1082 if (ubi_num < 0 || ubi_num >= UBI_MAX_DEVICES)
1085 ubi = ubi_get_device(ubi_num);
1101 ubi_devices[ubi_num] = NULL;
1104 ubi_assert(ubi_num == ubi->ubi_num);
1268 err = ubi_attach_mtd_dev(mtd, p->ubi_num,
1309 ubi_detach_mtd_dev(ubi_devices[k]->ubi_num, 1);
1333 ubi_detach_mtd_dev(ubi_devices[i]->ubi_num, 1);
1457 int err = kstrtoint(token, 10, &p->ubi_num);
1460 pr_err("UBI error: bad value for ubi_num parameter: %s",
1465 p->ubi_num = UBI_DEV_NUM_AUTO;
1472 MODULE_PARM_DESC(mtd, "MTD devices to attach. Parameter format: mtd=<name|num|path>[,<vid_hdr_offs>[,max_beb_per1024[,ubi_num]]].\n"
1478 "Optional \"ubi_num\" parameter specifies UBI device number which have to be assigned to the newly created UBI device (assigned automatically by default)\n"