mirror of
https://github.com/torvalds/linux.git
synced 2024-12-12 06:02:38 +00:00
e70e9ecd7c
Make pointer to bus_type a pointer to const for code safety. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Link: https://lore.kernel.org/r/20240216144027.185959-1-krzysztof.kozlowski@linaro.org Signed-off-by: Joerg Roedel <jroedel@suse.de>
32 lines
990 B
C
32 lines
990 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/* Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES.
|
|
*/
|
|
#ifndef __LINUX_IOMMU_PRIV_H
|
|
#define __LINUX_IOMMU_PRIV_H
|
|
|
|
#include <linux/iommu.h>
|
|
|
|
static inline const struct iommu_ops *dev_iommu_ops(struct device *dev)
|
|
{
|
|
/*
|
|
* Assume that valid ops must be installed if iommu_probe_device()
|
|
* has succeeded. The device ops are essentially for internal use
|
|
* within the IOMMU subsystem itself, so we should be able to trust
|
|
* ourselves not to misuse the helper.
|
|
*/
|
|
return dev->iommu->iommu_dev->ops;
|
|
}
|
|
|
|
int iommu_group_replace_domain(struct iommu_group *group,
|
|
struct iommu_domain *new_domain);
|
|
|
|
int iommu_device_register_bus(struct iommu_device *iommu,
|
|
const struct iommu_ops *ops,
|
|
const struct bus_type *bus,
|
|
struct notifier_block *nb);
|
|
void iommu_device_unregister_bus(struct iommu_device *iommu,
|
|
const struct bus_type *bus,
|
|
struct notifier_block *nb);
|
|
|
|
#endif /* __LINUX_IOMMU_PRIV_H */
|