mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
This was done entirely with mindless brute force, using
git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'
to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.
Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.
For the same reason the 'flex' versions will be done as a separate
conversion.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
62 lines
1.1 KiB
C
62 lines
1.1 KiB
C
// SPDX-License-Identifier: MIT
|
|
/*
|
|
* Copyright © 2023 Intel Corporation
|
|
*/
|
|
|
|
#include <linux/kobject.h>
|
|
#include <linux/sysfs.h>
|
|
#include <drm/drm_managed.h>
|
|
|
|
#include "xe_pm.h"
|
|
#include "xe_tile.h"
|
|
#include "xe_tile_sysfs.h"
|
|
#include "xe_vram_freq.h"
|
|
|
|
static void xe_tile_sysfs_kobj_release(struct kobject *kobj)
|
|
{
|
|
kfree(kobj);
|
|
}
|
|
|
|
static const struct kobj_type xe_tile_sysfs_kobj_type = {
|
|
.release = xe_tile_sysfs_kobj_release,
|
|
.sysfs_ops = &kobj_sysfs_ops,
|
|
};
|
|
|
|
static void tile_sysfs_fini(void *arg)
|
|
{
|
|
struct xe_tile *tile = arg;
|
|
|
|
kobject_put(tile->sysfs);
|
|
}
|
|
|
|
int xe_tile_sysfs_init(struct xe_tile *tile)
|
|
{
|
|
struct xe_device *xe = tile_to_xe(tile);
|
|
struct device *dev = xe->drm.dev;
|
|
struct kobj_tile *kt;
|
|
int err;
|
|
|
|
kt = kzalloc_obj(*kt);
|
|
if (!kt)
|
|
return -ENOMEM;
|
|
|
|
kobject_init(&kt->base, &xe_tile_sysfs_kobj_type);
|
|
kt->tile = tile;
|
|
|
|
err = kobject_add(&kt->base, &dev->kobj, "tile%d", tile->id);
|
|
if (err)
|
|
goto err_object;
|
|
|
|
tile->sysfs = &kt->base;
|
|
|
|
err = xe_vram_freq_sysfs_init(tile);
|
|
if (err)
|
|
goto err_object;
|
|
|
|
return devm_add_action_or_reset(xe->drm.dev, tile_sysfs_fini, tile);
|
|
|
|
err_object:
|
|
kobject_put(&kt->base);
|
|
return err;
|
|
}
|