Skip to content

Commit 5896e6e

Browse files
krzkjoergroedel
authored andcommitted
iommu: constify fwnode in iommu_ops_from_fwnode()
Make pointer to fwnode_handle a pointer to const for code safety. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent b42a905 commit 5896e6e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/iommu/iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2774,7 +2774,7 @@ bool iommu_default_passthrough(void)
27742774
}
27752775
EXPORT_SYMBOL_GPL(iommu_default_passthrough);
27762776

2777-
const struct iommu_ops *iommu_ops_from_fwnode(struct fwnode_handle *fwnode)
2777+
const struct iommu_ops *iommu_ops_from_fwnode(const struct fwnode_handle *fwnode)
27782778
{
27792779
const struct iommu_ops *ops = NULL;
27802780
struct iommu_device *iommu;

include/linux/iommu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ int iommu_fwspec_init(struct device *dev, struct fwnode_handle *iommu_fwnode,
986986
const struct iommu_ops *ops);
987987
void iommu_fwspec_free(struct device *dev);
988988
int iommu_fwspec_add_ids(struct device *dev, const u32 *ids, int num_ids);
989-
const struct iommu_ops *iommu_ops_from_fwnode(struct fwnode_handle *fwnode);
989+
const struct iommu_ops *iommu_ops_from_fwnode(const struct fwnode_handle *fwnode);
990990

991991
static inline struct iommu_fwspec *dev_iommu_fwspec_get(struct device *dev)
992992
{
@@ -1309,7 +1309,7 @@ static inline int iommu_fwspec_add_ids(struct device *dev, u32 *ids,
13091309
}
13101310

13111311
static inline
1312-
const struct iommu_ops *iommu_ops_from_fwnode(struct fwnode_handle *fwnode)
1312+
const struct iommu_ops *iommu_ops_from_fwnode(const struct fwnode_handle *fwnode)
13131313
{
13141314
return NULL;
13151315
}

0 commit comments

Comments
 (0)