Commit 5bb83841 authored by Michal Wajdeczko's avatar Michal Wajdeczko Committed by Rodrigo Vivi

drm/xe/kunit: Return number of iterated devices

In xe_call_for_each_device() we are already counting number of
iterated devices. Lets make that available to the caller too.
We will use that functionality in upcoming patches.
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20231115115816.1993-1-michal.wajdeczko@intel.comSigned-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent fcf98d68
......@@ -42,8 +42,8 @@ static int dev_to_xe_device_fn(struct device *dev, void *__data)
* function. Across each function call, drm_dev_enter() / drm_dev_exit() is
* called for the corresponding drm device.
*
* Return: Zero or the error code of a call to @xe_fn returning an error
* code.
* Return: Number of devices iterated or
* the error code of a call to @xe_fn returning an error code.
*/
int xe_call_for_each_device(xe_device_fn xe_fn)
{
......@@ -59,7 +59,7 @@ int xe_call_for_each_device(xe_device_fn xe_fn)
if (!data.ndevs)
kunit_skip(current->kunit_test, "test runs only on hardware\n");
return ret;
return ret ?: data.ndevs;
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment