summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-04-26 19:51:29 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2026-04-26 19:51:29 +0300
commit20b64cf8705a0f6268bb9a320eb6b4c425f3ec6c (patch)
tree6e55fdd6b6bfc4efe61d061cca785890663ba769 /drivers
parentb935117fe6d1af576e39b1f18c9e875f44bd146f (diff)
parent3177779ae17db4c66c851f799505fb95c7530c03 (diff)
downloadlinux-20b64cf8705a0f6268bb9a320eb6b4c425f3ec6c.tar.xz
Merge tag 'tsm-for-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/devsec/tsm
Pull PCIe TSP update from Dan Williams: "A small update for the TSM core. It is arguably a fix and coming in late as I have been offline the past few weeks: - Drop class_create() for the 'tsm' class" * tag 'tsm-for-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/devsec/tsm: virt: coco: change tsm_class to a const struct
Diffstat (limited to 'drivers')
-rw-r--r--drivers/virt/coco/tsm-core.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/virt/coco/tsm-core.c b/drivers/virt/coco/tsm-core.c
index 98dcf7d836df..e784993353d8 100644
--- a/drivers/virt/coco/tsm-core.c
+++ b/drivers/virt/coco/tsm-core.c
@@ -9,7 +9,11 @@
#include <linux/cleanup.h>
#include <linux/pci-tsm.h>
-static struct class *tsm_class;
+static void tsm_release(struct device *);
+static const struct class tsm_class = {
+ .name = "tsm",
+ .dev_release = tsm_release
+};
static DEFINE_IDA(tsm_ida);
static int match_id(struct device *dev, const void *data)
@@ -22,7 +26,7 @@ static int match_id(struct device *dev, const void *data)
struct tsm_dev *find_tsm_dev(int id)
{
- struct device *dev = class_find_device(tsm_class, NULL, &id, match_id);
+ struct device *dev = class_find_device(&tsm_class, NULL, &id, match_id);
if (!dev)
return NULL;
@@ -46,7 +50,7 @@ static struct tsm_dev *alloc_tsm_dev(struct device *parent)
tsm_dev->id = id;
dev = &tsm_dev->dev;
dev->parent = parent;
- dev->class = tsm_class;
+ dev->class = &tsm_class;
device_initialize(dev);
return no_free_ptr(tsm_dev);
@@ -114,18 +118,13 @@ static void tsm_release(struct device *dev)
static int __init tsm_init(void)
{
- tsm_class = class_create("tsm");
- if (IS_ERR(tsm_class))
- return PTR_ERR(tsm_class);
-
- tsm_class->dev_release = tsm_release;
- return 0;
+ return class_register(&tsm_class);
}
module_init(tsm_init)
static void __exit tsm_exit(void)
{
- class_destroy(tsm_class);
+ class_unregister(&tsm_class);
}
module_exit(tsm_exit)