mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
drm/xe/tile: Abort driver load for sysfs creation failure
Ensure that the status of all tile associated sysfs entries creation is relayed to xe_tile_init_noalloc, leading to a driver load abort if any sysfs creation failures occur. -v2 Avoid unnecessary warn/error messages. (Lucas) Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240412181211.1155732-7-himal.prasad.ghimiray@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
This commit is contained in:
committed by
Lucas De Marchi
parent
9c3f72a342
commit
e3d0839aa5
@@ -29,7 +29,7 @@ static void tile_sysfs_fini(struct drm_device *drm, void *arg)
|
||||
kobject_put(tile->sysfs);
|
||||
}
|
||||
|
||||
void xe_tile_sysfs_init(struct xe_tile *tile)
|
||||
int xe_tile_sysfs_init(struct xe_tile *tile)
|
||||
{
|
||||
struct xe_device *xe = tile_to_xe(tile);
|
||||
struct device *dev = xe->drm.dev;
|
||||
@@ -38,7 +38,7 @@ void xe_tile_sysfs_init(struct xe_tile *tile)
|
||||
|
||||
kt = kzalloc(sizeof(*kt), GFP_KERNEL);
|
||||
if (!kt)
|
||||
return;
|
||||
return -ENOMEM;
|
||||
|
||||
kobject_init(&kt->base, &xe_tile_sysfs_kobj_type);
|
||||
kt->tile = tile;
|
||||
@@ -46,16 +46,14 @@ void xe_tile_sysfs_init(struct xe_tile *tile)
|
||||
err = kobject_add(&kt->base, &dev->kobj, "tile%d", tile->id);
|
||||
if (err) {
|
||||
kobject_put(&kt->base);
|
||||
drm_warn(&xe->drm, "failed to register TILE sysfs directory, err: %d\n", err);
|
||||
return;
|
||||
return err;
|
||||
}
|
||||
|
||||
tile->sysfs = &kt->base;
|
||||
|
||||
xe_vram_freq_sysfs_init(tile);
|
||||
|
||||
err = drmm_add_action_or_reset(&xe->drm, tile_sysfs_fini, tile);
|
||||
err = xe_vram_freq_sysfs_init(tile);
|
||||
if (err)
|
||||
drm_warn(&xe->drm, "%s: drmm_add_action_or_reset failed, err: %d\n",
|
||||
__func__, err);
|
||||
return err;
|
||||
|
||||
return drmm_add_action_or_reset(&xe->drm, tile_sysfs_fini, tile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user