Lines Matching refs:mc_uapi
475 struct fsl_mc_uapi *mc_uapi; in fsl_mc_uapi_dev_open() local
483 mc_uapi = container_of(filep->private_data, struct fsl_mc_uapi, misc); in fsl_mc_uapi_dev_open()
484 mc_bus = container_of(mc_uapi, struct fsl_mc_bus, uapi_misc); in fsl_mc_uapi_dev_open()
487 mutex_lock(&mc_uapi->mutex); in fsl_mc_uapi_dev_open()
489 if (!mc_uapi->local_instance_in_use) { in fsl_mc_uapi_dev_open()
490 priv_data->mc_io = mc_uapi->static_mc_io; in fsl_mc_uapi_dev_open()
491 mc_uapi->local_instance_in_use = 1; in fsl_mc_uapi_dev_open()
503 priv_data->uapi = mc_uapi; in fsl_mc_uapi_dev_open()
506 mutex_unlock(&mc_uapi->mutex); in fsl_mc_uapi_dev_open()
511 mutex_unlock(&mc_uapi->mutex); in fsl_mc_uapi_dev_open()
520 struct fsl_mc_uapi *mc_uapi; in fsl_mc_uapi_dev_release() local
524 mc_uapi = priv_data->uapi; in fsl_mc_uapi_dev_release()
527 mutex_lock(&mc_uapi->mutex); in fsl_mc_uapi_dev_release()
529 if (mc_io == mc_uapi->static_mc_io) in fsl_mc_uapi_dev_release()
530 mc_uapi->local_instance_in_use = 0; in fsl_mc_uapi_dev_release()
537 mutex_unlock(&mc_uapi->mutex); in fsl_mc_uapi_dev_release()
576 struct fsl_mc_uapi *mc_uapi = &mc_bus->uapi_misc; in fsl_mc_uapi_create_device_file() local
579 mc_uapi->misc.minor = MISC_DYNAMIC_MINOR; in fsl_mc_uapi_create_device_file()
580 mc_uapi->misc.name = dev_name(&mc_dev->dev); in fsl_mc_uapi_create_device_file()
581 mc_uapi->misc.fops = &fsl_mc_uapi_dev_fops; in fsl_mc_uapi_create_device_file()
583 error = misc_register(&mc_uapi->misc); in fsl_mc_uapi_create_device_file()
587 mc_uapi->static_mc_io = mc_bus->mc_dev.mc_io; in fsl_mc_uapi_create_device_file()
589 mutex_init(&mc_uapi->mutex); in fsl_mc_uapi_create_device_file()