diff options
author | Nipun Gupta <nipun.gupta@nxp.com> | 2016-06-29 22:44:39 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-21 18:32:26 +0200 |
commit | df5e9b5fbc4e68a0f0345fbc0f65e60d7440279f (patch) | |
tree | feb9cdbe6b3292d4600ebddac111d6e7ec3d75cd /drivers/staging/fsl-mc/include/mc.h | |
parent | 243d38aab204bfd1c33ad6f412b654c9f7eed8cb (diff) | |
download | op-kernel-dev-df5e9b5fbc4e68a0f0345fbc0f65e60d7440279f.zip op-kernel-dev-df5e9b5fbc4e68a0f0345fbc0f65e60d7440279f.tar.gz |
fsl-mc: add helper macro to determine if a device is of fsl_mc type
Add a helper macro to return if a device has a bus type of fsl_mc.
This makes the bus driver code more readable and provides a way for
drivers like the SMMU driver to easily check the bus type.
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Bharat Bhushan <bharat.bhushan@nxp.com>
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fsl-mc/include/mc.h')
-rw-r--r-- | drivers/staging/fsl-mc/include/mc.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/fsl-mc/include/mc.h b/drivers/staging/fsl-mc/include/mc.h index 853cbf3..2d67535 100644 --- a/drivers/staging/fsl-mc/include/mc.h +++ b/drivers/staging/fsl-mc/include/mc.h @@ -166,6 +166,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 |