[PATCH 08/14] staging: fsl-mc: move couple of definitions to public header

From: laurentiu.tudor
Date: Thu Jun 22 2017 - 09:37:31 EST


From: Laurentiu Tudor <laurentiu.tudor@xxxxxxx>

Define dev_is_fsl_mc() and the bus type definition (fsl_mc_bus_type)
are used externally so move them to the public header.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@xxxxxxx>
---
drivers/staging/fsl-mc/include/mc-bus.h | 9 ---------
drivers/staging/fsl-mc/include/mc.h | 9 +++++++++
2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/fsl-mc/include/mc-bus.h b/drivers/staging/fsl-mc/include/mc-bus.h
index 0860681..a79a679 100644
--- a/drivers/staging/fsl-mc/include/mc-bus.h
+++ b/drivers/staging/fsl-mc/include/mc-bus.h
@@ -20,13 +20,6 @@
*/
#define FSL_MC_IRQ_POOL_MAX_TOTAL_IRQS 256

-#ifdef CONFIG_FSL_MC_BUS
-#define dev_is_fsl_mc(_dev) ((_dev)->bus == &fsl_mc_bus_type)
-#else
-/* If fsl-mc bus is not present device cannot belong to fsl-mc bus */
-#define dev_is_fsl_mc(_dev) (0)
-#endif
-
/**
* struct fsl_mc_resource_pool - Pool of MC resources of a given
* type
@@ -81,6 +74,4 @@ void fsl_mc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev);

bool fsl_mc_is_root_dprc(struct device *dev);

-extern struct bus_type fsl_mc_bus_type;
-
#endif /* _FSL_MC_MCBUS_H_ */
diff --git a/drivers/staging/fsl-mc/include/mc.h b/drivers/staging/fsl-mc/include/mc.h
index adb2378..d37e2c7 100644
--- a/drivers/staging/fsl-mc/include/mc.h
+++ b/drivers/staging/fsl-mc/include/mc.h
@@ -201,6 +201,13 @@ struct fsl_mc_device {
#define to_fsl_mc_device(_dev) \
container_of(_dev, struct fsl_mc_device, dev)

+#ifdef CONFIG_FSL_MC_BUS
+#define dev_is_fsl_mc(_dev) ((_dev)->bus == &fsl_mc_bus_type)
+#else
+/* If fsl-mc bus is not present device cannot belong to fsl-mc bus */
+#define dev_is_fsl_mc(_dev) (0)
+#endif
+
/*
* module_fsl_mc_driver() - Helper macro for drivers that don't do
* anything special in module init/exit. This eliminates a lot of
@@ -244,4 +251,6 @@ int __must_check fsl_mc_allocate_irqs(struct fsl_mc_device *mc_dev);

void fsl_mc_free_irqs(struct fsl_mc_device *mc_dev);

+extern struct bus_type fsl_mc_bus_type;
+
#endif /* _FSL_MC_H_ */
--
2.9.4