aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/efi_driver/efi_block_device.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c
index 5b9c139f38..7b71b4dd2e 100644
--- a/lib/efi_driver/efi_block_device.c
+++ b/lib/efi_driver/efi_block_device.c
@@ -38,7 +38,7 @@
38 * handle handle of the controller on which this driver is installed 38 * handle handle of the controller on which this driver is installed
39 * io block io protocol proxied by this driver 39 * io block io protocol proxied by this driver
40 */ 40 */
41struct efi_blk_priv { 41struct efi_blk_platdata {
42 efi_handle_t handle; 42 efi_handle_t handle;
43 struct efi_block_io *io; 43 struct efi_block_io *io;
44}; 44};
@@ -55,8 +55,8 @@ struct efi_blk_priv {
55static ulong efi_bl_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, 55static ulong efi_bl_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
56 void *buffer) 56 void *buffer)
57{ 57{
58 struct efi_blk_priv *priv = dev->priv; 58 struct efi_blk_platdata *platdata = dev_get_platdata(dev);
59 struct efi_block_io *io = priv->io; 59 struct efi_block_io *io = platdata->io;
60 efi_status_t ret; 60 efi_status_t ret;
61 61
62 EFI_PRINT("%s: read '%s', from block " LBAFU ", " LBAFU " blocks\n", 62 EFI_PRINT("%s: read '%s', from block " LBAFU ", " LBAFU " blocks\n",
@@ -84,8 +84,8 @@ static ulong efi_bl_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
84static ulong efi_bl_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, 84static ulong efi_bl_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
85 const void *buffer) 85 const void *buffer)
86{ 86{
87 struct efi_blk_priv *priv = dev->priv; 87 struct efi_blk_platdata *platdata = dev_get_platdata(dev);
88 struct efi_block_io *io = priv->io; 88 struct efi_block_io *io = platdata->io;
89 efi_status_t ret; 89 efi_status_t ret;
90 90
91 EFI_PRINT("%s: write '%s', from block " LBAFU ", " LBAFU " blocks\n", 91 EFI_PRINT("%s: write '%s', from block " LBAFU ", " LBAFU " blocks\n",
@@ -135,7 +135,7 @@ static int efi_bl_bind(efi_handle_t handle, void *interface)
135 struct efi_object *obj = efi_search_obj(handle); 135 struct efi_object *obj = efi_search_obj(handle);
136 struct efi_block_io *io = interface; 136 struct efi_block_io *io = interface;
137 int disks; 137 int disks;
138 struct efi_blk_priv *priv; 138 struct efi_blk_platdata *platdata;
139 139
140 EFI_PRINT("%s: handle %p, interface %p\n", __func__, handle, io); 140 EFI_PRINT("%s: handle %p, interface %p\n", __func__, handle, io);
141 141
@@ -163,16 +163,16 @@ static int efi_bl_bind(efi_handle_t handle, void *interface)
163 return -ENOENT; 163 return -ENOENT;
164 /* Set the DM_FLAG_NAME_ALLOCED flag to avoid a memory leak */ 164 /* Set the DM_FLAG_NAME_ALLOCED flag to avoid a memory leak */
165 device_set_name_alloced(bdev); 165 device_set_name_alloced(bdev);
166 /* Allocate priv */ 166
167 platdata = dev_get_platdata(bdev);
168 platdata->handle = handle;
169 platdata->io = interface;
170
167 ret = device_probe(bdev); 171 ret = device_probe(bdev);
168 if (ret) 172 if (ret)
169 return ret; 173 return ret;
170 EFI_PRINT("%s: block device '%s' created\n", __func__, bdev->name); 174 EFI_PRINT("%s: block device '%s' created\n", __func__, bdev->name);
171 175
172 priv = bdev->priv;
173 priv->handle = handle;
174 priv->io = interface;
175
176 ret = blk_prepare_device(bdev); 176 ret = blk_prepare_device(bdev);
177 177
178 /* Create handles for the partions of the block device */ 178 /* Create handles for the partions of the block device */
@@ -193,7 +193,7 @@ U_BOOT_DRIVER(efi_blk) = {
193 .name = "efi_blk", 193 .name = "efi_blk",
194 .id = UCLASS_BLK, 194 .id = UCLASS_BLK,
195 .ops = &efi_blk_ops, 195 .ops = &efi_blk_ops,
196 .priv_auto_alloc_size = sizeof(struct efi_blk_priv), 196 .platdata_auto_alloc_size = sizeof(struct efi_blk_platdata),
197}; 197};
198 198
199/* EFI driver operators */ 199/* EFI driver operators */