[PATCH RFC 04/15] coresight: make API private

From: Mian Yousaf Kaukab
Date: Fri Jan 17 2020 - 09:39:27 EST


There are no external users of coresight API. Move the function
prototypes to coresight-priv.h.

Not removing the whole file as there are following two users of it:
arch/arm/kernel/hw_breakpoint.c
drivers/misc/habanalabs/goya/goya_coresight.c

Lets clean this in a future patch.

Signed-off-by: Mian Yousaf Kaukab <ykaukab@xxxxxxx>
---
drivers/hwtracing/coresight/coresight-priv.h | 22 ++++++++++++
include/linux/coresight.h | 50 ----------------------------
2 files changed, 22 insertions(+), 50 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h
index 82e563cdc879..e6eec9f46e13 100644
--- a/drivers/hwtracing/coresight/coresight-priv.h
+++ b/drivers/hwtracing/coresight/coresight-priv.h
@@ -202,4 +202,26 @@ static inline void *coresight_get_uci_data(const struct amba_id *id)

void coresight_release_platform_data(struct coresight_platform_data *pdata);

+extern struct coresight_device *
+coresight_register(struct coresight_desc *desc);
+extern void coresight_unregister(struct coresight_device *csdev);
+extern int coresight_enable(struct coresight_device *csdev);
+extern void coresight_disable(struct coresight_device *csdev);
+extern int coresight_timeout(void __iomem *addr, u32 offset,
+ int position, int value);
+
+extern int coresight_claim_device(void __iomem *base);
+extern int coresight_claim_device_unlocked(void __iomem *base);
+
+extern void coresight_disclaim_device(void __iomem *base);
+extern void coresight_disclaim_device_unlocked(void __iomem *base);
+extern char *coresight_alloc_device_name(struct coresight_dev_list *devs,
+ struct device *dev);
+
+extern bool coresight_loses_context_with_cpu(struct device *dev);
+
+extern int coresight_get_cpu(struct device *dev);
+
+struct coresight_platform_data *coresight_get_platform_data(struct device *dev);
+
#endif
diff --git a/include/linux/coresight.h b/include/linux/coresight.h
index 44e552de419c..8b39a83732b8 100644
--- a/include/linux/coresight.h
+++ b/include/linux/coresight.h
@@ -269,54 +269,4 @@ struct coresight_ops {
const struct coresight_ops_helper *helper_ops;
};

-#ifdef CONFIG_CORESIGHT
-extern struct coresight_device *
-coresight_register(struct coresight_desc *desc);
-extern void coresight_unregister(struct coresight_device *csdev);
-extern int coresight_enable(struct coresight_device *csdev);
-extern void coresight_disable(struct coresight_device *csdev);
-extern int coresight_timeout(void __iomem *addr, u32 offset,
- int position, int value);
-
-extern int coresight_claim_device(void __iomem *base);
-extern int coresight_claim_device_unlocked(void __iomem *base);
-
-extern void coresight_disclaim_device(void __iomem *base);
-extern void coresight_disclaim_device_unlocked(void __iomem *base);
-extern char *coresight_alloc_device_name(struct coresight_dev_list *devs,
- struct device *dev);
-
-extern bool coresight_loses_context_with_cpu(struct device *dev);
-#else
-static inline struct coresight_device *
-coresight_register(struct coresight_desc *desc) { return NULL; }
-static inline void coresight_unregister(struct coresight_device *csdev) {}
-static inline int
-coresight_enable(struct coresight_device *csdev) { return -ENOSYS; }
-static inline void coresight_disable(struct coresight_device *csdev) {}
-static inline int coresight_timeout(void __iomem *addr, u32 offset,
- int position, int value) { return 1; }
-static inline int coresight_claim_device_unlocked(void __iomem *base)
-{
- return -EINVAL;
-}
-
-static inline int coresight_claim_device(void __iomem *base)
-{
- return -EINVAL;
-}
-
-static inline void coresight_disclaim_device(void __iomem *base) {}
-static inline void coresight_disclaim_device_unlocked(void __iomem *base) {}
-
-static inline bool coresight_loses_context_with_cpu(struct device *dev)
-{
- return false;
-}
-#endif
-
-extern int coresight_get_cpu(struct device *dev);
-
-struct coresight_platform_data *coresight_get_platform_data(struct device *dev);
-
#endif
--
2.16.4