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-allocator.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-allocator.c')
-rw-r--r-- | drivers/staging/fsl-mc/bus/mc-allocator.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/fsl-mc/bus/mc-allocator.c b/drivers/staging/fsl-mc/bus/mc-allocator.c index e59d850..0f50a07 100644 --- a/drivers/staging/fsl-mc/bus/mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/mc-allocator.c @@ -281,7 +281,7 @@ int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev, if (mc_dev->flags & FSL_MC_IS_DPRC) { mc_bus_dev = mc_dev; } else { - if (WARN_ON(mc_dev->dev.parent->bus != &fsl_mc_bus_type)) + if (WARN_ON(!dev_is_fsl_mc(mc_dev->dev.parent))) return error; mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent); @@ -420,7 +420,7 @@ int __must_check fsl_mc_object_allocate(struct fsl_mc_device *mc_dev, if (WARN_ON(mc_dev->flags & FSL_MC_IS_DPRC)) goto error; - if (WARN_ON(mc_dev->dev.parent->bus != &fsl_mc_bus_type)) + if (WARN_ON(!dev_is_fsl_mc(mc_dev->dev.parent))) goto error; if (WARN_ON(pool_type == FSL_MC_POOL_DPMCP)) @@ -678,7 +678,7 @@ static int fsl_mc_allocator_probe(struct fsl_mc_device *mc_dev) return -EINVAL; mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent); - if (WARN_ON(mc_bus_dev->dev.bus != &fsl_mc_bus_type)) + if (WARN_ON(!dev_is_fsl_mc(&mc_bus_dev->dev))) return -EINVAL; mc_bus = to_fsl_mc_bus(mc_bus_dev); |