Lines Matching refs:ubi_num
53 * @ubi_num: UBI number
60 int ubi_num;
248 * @ubi_num: UBI device number
251 * @ubi_num, or %NULL if the device does not exist. This function increases the
255 struct ubi_device *ubi_get_device(int ubi_num)
260 ubi = ubi_devices[ubi_num];
321 int i, ubi_num = -ENODEV;
328 ubi_num = ubi->ubi_num;
334 return ubi_num;
352 * we still can use 'ubi->ubi_num'.
439 sprintf(ubi->ubi_name, UBI_NAME_STR "%d", ubi->ubi_num);
462 dev_set_name(&ubi->dev, UBI_NAME_STR "%d", ubi->ubi_num);
824 * @ubi_num: number to assign to the new UBI device
829 * This function attaches MTD device @mtd_dev to UBI and assign @ubi_num number
830 * to the newly created UBI device, unless @ubi_num is %UBI_DEV_NUM_AUTO, in
842 int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
904 if (ubi_num == UBI_DEV_NUM_AUTO) {
906 for (ubi_num = 0; ubi_num < UBI_MAX_DEVICES; ubi_num++)
907 if (!ubi_devices[ubi_num])
909 if (ubi_num == UBI_MAX_DEVICES) {
915 if (ubi_num >= UBI_MAX_DEVICES)
918 /* Make sure ubi_num is not busy */
919 if (ubi_devices[ubi_num]) {
920 pr_err("ubi: ubi%i already exists\n", ubi_num);
936 ubi->ubi_num = ubi_num;
1052 ubi_devices[ubi_num] = ubi;
1054 return ubi_num;
1073 * @ubi_num: UBI device number to detach from
1076 * This function destroys an UBI device number @ubi_num and detaches the
1084 int ubi_detach_mtd_dev(int ubi_num, int anyway)
1088 if (ubi_num < 0 || ubi_num >= UBI_MAX_DEVICES)
1091 ubi = ubi_get_device(ubi_num);
1107 ubi_devices[ubi_num] = NULL;
1110 ubi_assert(ubi_num == ubi->ubi_num);
1274 err = ubi_attach_mtd_dev(mtd, p->ubi_num,
1316 ubi_detach_mtd_dev(ubi_devices[k]->ubi_num, 1);
1340 ubi_detach_mtd_dev(ubi_devices[i]->ubi_num, 1);
1463 int err = kstrtoint(token, 10, &p->ubi_num);
1466 pr_err("UBI error: bad value for ubi_num parameter: %s\n",
1471 p->ubi_num = UBI_DEV_NUM_AUTO;
1490 MODULE_PARM_DESC(mtd, "MTD devices to attach. Parameter format: mtd=<name|num|path>[,<vid_hdr_offs>[,max_beb_per1024[,ubi_num]]].\n"
1496 "Optional \"ubi_num\" parameter specifies UBI device number which have to be assigned to the newly created UBI device (assigned automatically by default)\n"