/* Find an efiobj from device-path, if 'rem' is not NULL, returns the remaining part of the device path after the matched object.  */
struct efi_object* efi_dp_find_obj(struct efi_device_path *dp, struct efi_device_path **rem)
/* Find an efiobj from device-path, if 'rem' is not NULL, returns the remaining part of the device path after the matched object.  */
struct efi_object* efi_dp_find_obj(struct efi_device_path *dp, struct efi_device_path **rem)
{
	struct efi_object *efiobj;
	efiobj = find_obj(dp, false, NULL);
	if (!efiobj)
		efiobj = find_obj(dp, false, rem);
	if (!efiobj)
		efiobj = find_obj(dp, true, rem);
	return efiobj;
}