diff options
author | Nipun Gupta <nipun.gupta@nxp.com> | 2016-06-29 17:14:39 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-21 16:32:26 (GMT) |
commit | df5e9b5fbc4e68a0f0345fbc0f65e60d7440279f (patch) | |
tree | feb9cdbe6b3292d4600ebddac111d6e7ec3d75cd /drivers/staging/fsl-mc/bus/mc-bus.c | |
parent | 243d38aab204bfd1c33ad6f412b654c9f7eed8cb (diff) | |
download | linux-df5e9b5fbc4e68a0f0345fbc0f65e60d7440279f.tar.xz |
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/bus/mc-bus.c')
-rw-r--r-- | drivers/staging/fsl-mc/bus/mc-bus.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/fsl-mc/bus/mc-bus.c b/drivers/staging/fsl-mc/bus/mc-bus.c index db3afdb..b549005 100644 --- a/drivers/staging/fsl-mc/bus/mc-bus.c +++ b/drivers/staging/fsl-mc/bus/mc-bus.c @@ -236,11 +236,11 @@ static void fsl_mc_get_root_dprc(struct device *dev, { if (WARN_ON(!dev)) { *root_dprc_dev = NULL; - } else if (WARN_ON(dev->bus != &fsl_mc_bus_type)) { + } else if (WARN_ON(!dev_is_fsl_mc(dev))) { *root_dprc_dev = NULL; } else { *root_dprc_dev = dev; - while ((*root_dprc_dev)->parent->bus == &fsl_mc_bus_type) + while (dev_is_fsl_mc((*root_dprc_dev)->parent)) *root_dprc_dev = (*root_dprc_dev)->parent; } } @@ -434,7 +434,7 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc, struct fsl_mc_bus *mc_bus = NULL; struct fsl_mc_device *parent_mc_dev; - if (parent_dev->bus == &fsl_mc_bus_type) + if (dev_is_fsl_mc(parent_dev)) parent_mc_dev = to_fsl_mc_device(parent_dev); else parent_mc_dev = NULL; |