mirror of
https://github.com/torvalds/linux.git
synced 2026-04-20 07:43:57 -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>
56 lines
997 B
C
56 lines
997 B
C
// SPDX-License-Identifier: MIT
|
|
/*
|
|
* Copyright © 2022 Intel Corporation
|
|
*/
|
|
|
|
#include "xe_gt_sysfs.h"
|
|
|
|
#include <linux/kobject.h>
|
|
#include <linux/sysfs.h>
|
|
|
|
#include <drm/drm_managed.h>
|
|
|
|
#include "xe_gt_types.h"
|
|
|
|
static void xe_gt_sysfs_kobj_release(struct kobject *kobj)
|
|
{
|
|
kfree(kobj);
|
|
}
|
|
|
|
static const struct kobj_type xe_gt_sysfs_kobj_type = {
|
|
.release = xe_gt_sysfs_kobj_release,
|
|
.sysfs_ops = &kobj_sysfs_ops,
|
|
};
|
|
|
|
static void gt_sysfs_fini(void *arg)
|
|
{
|
|
struct xe_gt *gt = arg;
|
|
|
|
kobject_put(gt->sysfs);
|
|
}
|
|
|
|
int xe_gt_sysfs_init(struct xe_gt *gt)
|
|
{
|
|
struct xe_tile *tile = gt_to_tile(gt);
|
|
struct xe_device *xe = gt_to_xe(gt);
|
|
struct kobj_gt *kg;
|
|
int err;
|
|
|
|
kg = kzalloc_obj(*kg);
|
|
if (!kg)
|
|
return -ENOMEM;
|
|
|
|
kobject_init(&kg->base, &xe_gt_sysfs_kobj_type);
|
|
kg->gt = gt;
|
|
|
|
err = kobject_add(&kg->base, tile->sysfs, "gt%d", gt->info.id);
|
|
if (err) {
|
|
kobject_put(&kg->base);
|
|
return err;
|
|
}
|
|
|
|
gt->sysfs = &kg->base;
|
|
|
|
return devm_add_action_or_reset(xe->drm.dev, gt_sysfs_fini, gt);
|
|
}
|