struct fsl_mc_driver *mc_drv = to_fsl_mc_driver(drv);
bool found = false;
- if (WARN_ON(!fsl_mc_bus_exists()))
- goto out;
-
if (!mc_drv->match_id_table)
goto out;
};
EXPORT_SYMBOL_GPL(fsl_mc_bus_type);
-static atomic_t root_dprc_count = ATOMIC_INIT(0);
-
static int fsl_mc_driver_probe(struct device *dev)
{
struct fsl_mc_driver *mc_drv;
}
EXPORT_SYMBOL_GPL(fsl_mc_driver_unregister);
-/**
- * fsl_mc_bus_exists - check if a root dprc exists
- */
-bool fsl_mc_bus_exists(void)
-{
- return atomic_read(&root_dprc_count) > 0;
-}
-EXPORT_SYMBOL_GPL(fsl_mc_bus_exists);
-
/**
* fsl_mc_get_root_dprc - function to traverse to the root dprc
*/
}
mc_io2 = mc_io;
-
- atomic_inc(&root_dprc_count);
}
error = get_dprc_icid(mc_io2, obj_desc->id, &mc_dev->icid);
device_del(&mc_dev->dev);
put_device(&mc_dev->dev);
- if (strcmp(mc_dev->obj_desc.type, "dprc") == 0) {
+ if (strcmp(mc_dev->obj_desc.type, "dprc") == 0)
mc_bus = to_fsl_mc_bus(mc_dev);
- if (fsl_mc_is_root_dprc(&mc_dev->dev)) {
- if (atomic_read(&root_dprc_count) > 0)
- atomic_dec(&root_dprc_count);
- else
- WARN_ON(1);
- }
- }
-
if (mc_bus)
devm_kfree(mc_dev->dev.parent, mc_bus);
else