mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-11-04 05:50:17 +00:00 
			
		
		
		
	efi_loader: disk: not create BLK device for BLK(IF_TYPE_EFI_LOADER) devices
When we create an efi_disk device with an UEFI application using driver binding protocol, the 'efi_driver' framework tries to create a corresponding block device(UCLASS_BLK/IF_TYPE_EFI). This will lead to calling a PROBE callback, efi_disk_probe(). In this case, however, we don't need to create another "efi_disk" device as we already have this device instance. So we should avoid recursively invoke further processing in the callback function. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
		
							parent
							
								
									a9bf024b29
								
							
						
					
					
						commit
						3c809dfed7
					
				@ -604,6 +604,7 @@ static int efi_disk_probe(void *ctx, struct event *event)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	struct udevice *dev;
 | 
						struct udevice *dev;
 | 
				
			||||||
	enum uclass_id id;
 | 
						enum uclass_id id;
 | 
				
			||||||
 | 
						struct blk_desc *desc;
 | 
				
			||||||
	struct udevice *child;
 | 
						struct udevice *child;
 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -614,9 +615,16 @@ static int efi_disk_probe(void *ctx, struct event *event)
 | 
				
			|||||||
	if (id != UCLASS_BLK)
 | 
						if (id != UCLASS_BLK)
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = efi_disk_create_raw(dev);
 | 
						/*
 | 
				
			||||||
	if (ret)
 | 
						 * avoid creating duplicated objects now that efi_driver
 | 
				
			||||||
		return -1;
 | 
						 * has already created an efi_disk at this moment.
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						desc = dev_get_uclass_plat(dev);
 | 
				
			||||||
 | 
						if (desc->if_type != IF_TYPE_EFI_LOADER) {
 | 
				
			||||||
 | 
							ret = efi_disk_create_raw(dev);
 | 
				
			||||||
 | 
							if (ret)
 | 
				
			||||||
 | 
								return -1;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	device_foreach_child(child, dev) {
 | 
						device_foreach_child(child, dev) {
 | 
				
			||||||
		ret = efi_disk_create_part(child);
 | 
							ret = efi_disk_create_part(child);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user