iommu: constify fwnode in iommu_ops_from_fwnode()
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Fri, 16 Feb 2024 14:40:26 +0000 (15:40 +0100)
committerJoerg Roedel <jroedel@suse.de>
Fri, 1 Mar 2024 12:47:01 +0000 (13:47 +0100)
Make pointer to fwnode_handle a pointer to const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240216144027.185959-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c
include/linux/iommu.h

index b0a41f598dcf1ff56120004c09af6c8bb1fcf333..28b18ed83273f24ecd38c283a37ff46968df99fd 100644 (file)
@@ -2774,7 +2774,7 @@ bool iommu_default_passthrough(void)
 }
 EXPORT_SYMBOL_GPL(iommu_default_passthrough);
 
-const struct iommu_ops *iommu_ops_from_fwnode(struct fwnode_handle *fwnode)
+const struct iommu_ops *iommu_ops_from_fwnode(const struct fwnode_handle *fwnode)
 {
        const struct iommu_ops *ops = NULL;
        struct iommu_device *iommu;
index 98a958621dcbb08cedea6130a2b3809c83cd6104..7c80322024578f5c52a3ca153d5f41d1561f24ab 100644 (file)
@@ -986,7 +986,7 @@ int iommu_fwspec_init(struct device *dev, struct fwnode_handle *iommu_fwnode,
                      const struct iommu_ops *ops);
 void iommu_fwspec_free(struct device *dev);
 int iommu_fwspec_add_ids(struct device *dev, const u32 *ids, int num_ids);
-const struct iommu_ops *iommu_ops_from_fwnode(struct fwnode_handle *fwnode);
+const struct iommu_ops *iommu_ops_from_fwnode(const struct fwnode_handle *fwnode);
 
 static inline struct iommu_fwspec *dev_iommu_fwspec_get(struct device *dev)
 {
@@ -1309,7 +1309,7 @@ static inline int iommu_fwspec_add_ids(struct device *dev, u32 *ids,
 }
 
 static inline
-const struct iommu_ops *iommu_ops_from_fwnode(struct fwnode_handle *fwnode)
+const struct iommu_ops *iommu_ops_from_fwnode(const struct fwnode_handle *fwnode)
 {
        return NULL;
 }