unsigned long start, lbaint_t blkcnt,
void *buffer)
{
- struct host_block_dev *host_dev = dev_get_priv(dev);
+ struct host_block_dev *host_dev = dev_get_platdata(dev);
struct blk_desc *block_dev = dev_get_uclass_platdata(dev);
#else
unsigned long start, lbaint_t blkcnt,
const void *buffer)
{
- struct host_block_dev *host_dev = dev_get_priv(dev);
+ struct host_block_dev *host_dev = dev_get_platdata(dev);
struct blk_desc *block_dev = dev_get_uclass_platdata(dev);
#else
static unsigned long host_block_write(struct blk_desc *block_dev,
os_lseek(fd, 0, OS_SEEK_END) / 512, &dev);
if (ret)
goto err_file;
+
+ host_dev = dev_get_platdata(dev);
+ host_dev->fd = fd;
+ host_dev->filename = fname;
+
ret = device_probe(dev);
if (ret) {
device_unbind(dev);
goto err_file;
}
- host_dev = dev_get_priv(dev);
- host_dev->fd = fd;
- host_dev->filename = fname;
-
return blk_prepare_device(dev);
err_file:
os_close(fd);
.name = "sandbox_host_blk",
.id = UCLASS_BLK,
.ops = &sandbox_host_blk_ops,
- .priv_auto_alloc_size = sizeof(struct host_block_dev),
+ .platdata_auto_alloc_size = sizeof(struct host_block_dev),
};
#else
U_BOOT_LEGACY_BLK(sandbox_host) = {