Lines Matching refs:sysfs_mtd
496 DIR *sysfs_mtd; in sysfs_is_supported() local
499 sysfs_mtd = opendir(lib->sysfs_mtd); in sysfs_is_supported()
500 if (!sysfs_mtd) { in sysfs_is_supported()
505 return sys_errmsg("cannot open \"%s\"", lib->sysfs_mtd); in sysfs_is_supported()
517 dirent = readdir(sysfs_mtd); in sysfs_is_supported()
523 lib->sysfs_mtd, dirent->d_name); in sysfs_is_supported()
525 closedir(sysfs_mtd); in sysfs_is_supported()
537 if (closedir(sysfs_mtd)) in sysfs_is_supported()
538 return sys_errmsg("closedir failed on \"%s\"", lib->sysfs_mtd); in sysfs_is_supported()
565 lib->sysfs_mtd = mkpath("/sys", SYSFS_MTD); in libmtd_open()
566 if (!lib->sysfs_mtd) in libmtd_open()
569 lib->mtd = mkpath(lib->sysfs_mtd, MTD_NAME_PATT); in libmtd_open()
579 free(lib->sysfs_mtd); in libmtd_open()
581 lib->mtd_name = lib->mtd = lib->sysfs_mtd = NULL; in libmtd_open()
644 free(lib->sysfs_mtd); in libmtd_close()
664 DIR *sysfs_mtd; in mtd_get_info() local
679 sysfs_mtd = opendir(lib->sysfs_mtd); in mtd_get_info()
680 if (!sysfs_mtd) { in mtd_get_info()
685 return sys_errmsg("cannot open \"%s\"", lib->sysfs_mtd); in mtd_get_info()
694 dirent = readdir(sysfs_mtd); in mtd_get_info()
700 lib->sysfs_mtd, dirent->d_name); in mtd_get_info()
717 sys_errmsg("readdir failed on \"%s\"", lib->sysfs_mtd); in mtd_get_info()
721 if (closedir(sysfs_mtd)) in mtd_get_info()
722 return sys_errmsg("closedir failed on \"%s\"", lib->sysfs_mtd); in mtd_get_info()
730 closedir(sysfs_mtd); in mtd_get_info()