Lines Matching full:disk

18 LOG_MODULE_REGISTER(disk);
28 struct disk_info *disk = NULL, *itr; in disk_access_get_di() local
45 /* Check for disk name match */ in disk_access_get_di()
47 disk = itr; in disk_access_get_di()
53 return disk; in disk_access_get_di()
58 struct disk_info *disk = disk_access_get_di(pdrv); in disk_access_init() local
61 if ((disk != NULL) && (disk->ops != NULL) && in disk_access_init()
62 (disk->ops->init != NULL)) { in disk_access_init()
63 rc = disk->ops->init(disk); in disk_access_init()
71 struct disk_info *disk = disk_access_get_di(pdrv); in disk_access_status() local
74 if ((disk != NULL) && (disk->ops != NULL) && in disk_access_status()
75 (disk->ops->status != NULL)) { in disk_access_status()
76 rc = disk->ops->status(disk); in disk_access_status()
85 struct disk_info *disk = disk_access_get_di(pdrv); in disk_access_read() local
88 if ((disk != NULL) && (disk->ops != NULL) && in disk_access_read()
89 (disk->ops->read != NULL)) { in disk_access_read()
90 rc = disk->ops->read(disk, data_buf, start_sector, num_sector); in disk_access_read()
99 struct disk_info *disk = disk_access_get_di(pdrv); in disk_access_write() local
102 if ((disk != NULL) && (disk->ops != NULL) && in disk_access_write()
103 (disk->ops->write != NULL)) { in disk_access_write()
104 rc = disk->ops->write(disk, data_buf, start_sector, num_sector); in disk_access_write()
112 struct disk_info *disk = disk_access_get_di(pdrv); in disk_access_ioctl() local
115 if ((disk != NULL) && (disk->ops != NULL) && in disk_access_ioctl()
116 (disk->ops->ioctl != NULL)) { in disk_access_ioctl()
117 rc = disk->ops->ioctl(disk, cmd, buf); in disk_access_ioctl()
123 int disk_access_register(struct disk_info *disk) in disk_access_register() argument
128 if ((disk == NULL) || (disk->name == NULL)) { in disk_access_register()
129 LOG_ERR("invalid disk interface!!"); in disk_access_register()
134 if (disk_access_get_di(disk->name) != NULL) { in disk_access_register()
135 LOG_ERR("disk interface already registered!!"); in disk_access_register()
140 /* append to the disk list */ in disk_access_register()
141 sys_dlist_append(&disk_access_list, &disk->node); in disk_access_register()
142 LOG_DBG("disk interface(%s) registered", disk->name); in disk_access_register()
148 int disk_access_unregister(struct disk_info *disk) in disk_access_unregister() argument
153 if ((disk == NULL) || (disk->name == NULL)) { in disk_access_unregister()
154 LOG_ERR("invalid disk interface!!"); in disk_access_unregister()
159 if (disk_access_get_di(disk->name) == NULL) { in disk_access_unregister()
160 LOG_ERR("disk interface not registered!!"); in disk_access_unregister()
164 /* remove disk node from the list */ in disk_access_unregister()
165 sys_dlist_remove(&disk->node); in disk_access_unregister()
166 LOG_DBG("disk interface(%s) unregistered", disk->name); in disk_access_unregister()