Lines Matching refs:blk_dev

286     struct mmcsd_blk_device *blk_dev = raw_to_mmcsd_blk(disk);  in mmcsd_blk_read()  local
290 req_size = rt_min_t(rt_size_t, remain_size, blk_dev->max_req_size); in mmcsd_blk_read()
292 err = rt_mmcsd_req_blk(blk_dev->card, sector + offset, rd_ptr, req_size, 0); in mmcsd_blk_read()
315 struct mmcsd_blk_device *blk_dev = raw_to_mmcsd_blk(disk); in mmcsd_blk_write() local
319 req_size = rt_min_t(rt_size_t, remain_size, blk_dev->max_req_size); in mmcsd_blk_write()
321 err = rt_mmcsd_req_blk(blk_dev->card, sector + offset, wr_ptr, req_size, 1); in mmcsd_blk_write()
339 struct mmcsd_blk_device *blk_dev = raw_to_mmcsd_blk(disk); in mmcsd_blk_getgeome() local
341 rt_memcpy(geometry, &blk_dev->geometry, sizeof(*geometry)); in mmcsd_blk_getgeome()
357 struct mmcsd_blk_device *blk_dev = rt_calloc(1, sizeof(*blk_dev)); in rt_mmcsd_blk_probe() local
359 if (!blk_dev) in rt_mmcsd_blk_probe()
363 card->blk_dev = blk_dev; in rt_mmcsd_blk_probe()
366 blk_dev->parent.ida = &sdio_ida; in rt_mmcsd_blk_probe()
368 blk_dev->parent.parallel_io = RT_FALSE; in rt_mmcsd_blk_probe()
369 blk_dev->parent.removable = controller_is_removable(host); in rt_mmcsd_blk_probe()
370 blk_dev->parent.ops = &mmcsd_blk_ops; in rt_mmcsd_blk_probe()
371 blk_dev->parent.max_partitions = RT_MMCSD_MAX_PARTITION; in rt_mmcsd_blk_probe()
373 blk_dev->card = card; in rt_mmcsd_blk_probe()
374 blk_dev->max_req_size = rt_min_t(rt_size_t, in rt_mmcsd_blk_probe()
377 blk_dev->geometry.bytes_per_sector = 1 << 9; in rt_mmcsd_blk_probe()
378 blk_dev->geometry.block_size = card->card_blksize; in rt_mmcsd_blk_probe()
379 blk_dev->geometry.sector_count = card->card_capacity * (1024 / 512); in rt_mmcsd_blk_probe()
389 rt_dm_dev_set_name(&blk_dev->parent.parent, host->name); in rt_mmcsd_blk_probe()
391 rt_strncpy(blk_dev->parent.parent.parent.name, host->name, RT_NAME_MAX); in rt_mmcsd_blk_probe()
394 if ((err = rt_hw_blk_disk_register(&blk_dev->parent))) in rt_mmcsd_blk_probe()
402 card->blk_dev = RT_NULL; in rt_mmcsd_blk_probe()
403 free(blk_dev); in rt_mmcsd_blk_probe()
410 struct mmcsd_blk_device *blk_dev = card->blk_dev; in rt_mmcsd_blk_remove() local
412 if (!blk_dev) in rt_mmcsd_blk_remove()
417 if (!rt_hw_blk_disk_unregister(&blk_dev->parent)) in rt_mmcsd_blk_remove()
419 card->blk_dev = RT_NULL; in rt_mmcsd_blk_remove()
420 rt_free(blk_dev); in rt_mmcsd_blk_remove()