Re: [PATCH v3 13/23] drm/xe/kunit: Setup driver data in the test device
"Mallesh, Koujalagi" <[email protected]>
| Newsgroups | org.freedesktop.lists.intel-xe |
|---|---|
| Message-ID | <[email protected]> |
On 30-07-2026 08:51 pm, Michal Wajdeczko wrote: > While we have helpers pdev_to_xe_device() and kdev_to_xe_device() > to obtain the xe_device pointer from the struct device pointer or > from the struct pci_dev pointer, we must also setup the drm_device > pointer as driver data in the device to make them work. > > Signed-off-by: Michal Wajdeczko <[email protected]> LGTM, Reviewed-by: Mallesh Koujalagi <[email protected]> > --- > drivers/gpu/drm/xe/tests/xe_kunit_helpers.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/xe/tests/xe_kunit_helpers.c b/drivers/gpu/drm/xe/tests/xe_kunit_helpers.c > index bc5156966ce9..27740b40c8ae 100644 > --- a/drivers/gpu/drm/xe/tests/xe_kunit_helpers.c > +++ b/drivers/gpu/drm/xe/tests/xe_kunit_helpers.c > @@ -39,6 +39,10 @@ struct xe_device *xe_kunit_helper_alloc_xe_device(struct kunit *test, > struct xe_device, > drm, DRIVER_GEM); > KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xe); > + > + dev_set_drvdata(xe->drm.dev, &xe->drm); > + KUNIT_ASSERT_PTR_EQ(test, xe, kdev_to_xe_device(dev)); > + > return xe; > } > EXPORT_SYMBOL_IF_KUNIT(xe_kunit_helper_alloc_xe_device);