linux/drivers/iommu/iommu-sysfs.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * IOMMU sysfs class support
 *
 * Copyright (C) 2014 Red Hat, Inc.  All rights reserved.
 *     Author: Alex Williamson <[email protected]>
 */

#include <linux/device.h>
#include <linux/iommu.h>
#include <linux/init.h>
#include <linux/slab.h>

/*
 * We provide a common class "devices" group which initially has no attributes.
 * As devices are added to the IOMMU, we'll add links to the group.
 */
static struct attribute *devices_attr[] =;

static const struct attribute_group devices_attr_group =;

static const struct attribute_group *dev_groups[] =;

static void release_device(struct device *dev)
{}

static struct class iommu_class =;

static int __init iommu_dev_init(void)
{}
postcore_initcall(iommu_dev_init);

/*
 * Init the struct device for the IOMMU. IOMMU specific attributes can
 * be provided as an attribute group, allowing a unique namespace per
 * IOMMU type.
 */
int iommu_device_sysfs_add(struct iommu_device *iommu,
			   struct device *parent,
			   const struct attribute_group **groups,
			   const char *fmt, ...)
{}
EXPORT_SYMBOL_GPL();

void iommu_device_sysfs_remove(struct iommu_device *iommu)
{}
EXPORT_SYMBOL_GPL();

/*
 * IOMMU drivers can indicate a device is managed by a given IOMMU using
 * this interface.  A link to the device will be created in the "devices"
 * directory of the IOMMU device in sysfs and an "iommu" link will be
 * created under the linked device, pointing back at the IOMMU device.
 */
int iommu_device_link(struct iommu_device *iommu, struct device *link)
{}

void iommu_device_unlink(struct iommu_device *iommu, struct device *link)
{}