linux/drivers/gpu/drm/drm_client.c
/**
 * drm_client_init - Initialise a DRM client
 * @dev: DRM device
 * @client: DRM client
 * @name: Client name
 * @funcs: DRM client functions (optional)
 *
 * This initialises the client and opens a &drm_file. Use drm_client_add() to complete the process.
 * The caller needs to hold a reference on @dev before calling this function.
 * The client is freed when the &drm_device is unregistered. See drm_client_release().
 *
 * Returns:
 * Zero on success or negative error code on failure.
 */
Initialise a DRM client
@dev: DRM device
@client: DRM client
@name: Client name
@funcs: DRM client functions (optional)

This initialises the client and opens a &drm_file. Use drm_client_add() to complete the process.
The caller needs to hold a reference on @dev before calling this function.
The client is freed when the &drm_device is unregistered.

Zero on success or negative error code on failure.
Initialise a DRM client @dev : DRM device @client : DRM client @name : Client name @funcs : DRM client functions ( optional ) This initialises the client and opens a &drm_file . Use drm_client_add () to complete the process . The caller needs to hold a reference on @dev before calling this function . The client is freed when the &drm_device is unregistered . Zero on success or negative error code on failure .
int drm_client_init(struct drm_device *dev, struct drm_client_dev *client,
		    const char *name, const struct drm_client_funcs *funcs)
{
	int ret;
	if (!drm_core_check_feature(dev, DRIVER_MODESET) ||
	    !dev->driver->dumb_create || !dev->driver->gem_prime_vmap)
		return -ENOTSUPP;
	if (funcs && !try_module_get(funcs->owner))
		return -ENODEV;
	client->dev = dev;
	client->name = name;
	client->funcs = funcs;
	ret = drm_client_open(client);
	if (ret)
		goto err_put_module;
	drm_dev_get(dev);
	return 0;
err_put_module:
	if (funcs)
		module_put(funcs->owner);
	return ret;
}
int drm_client_init ( struct drm_device * dev , struct drm_client_dev * client , const char * name , const struct drm_client_funcs * funcs ) { int ret ; if ( ! drm_core_check_feature ( dev , DRIVER_MODESET ) || ! dev -> driver -> dumb_create || ! dev -> driver -> gem_prime_vmap ) return - ENOTSUPP ; if ( funcs && ! try_module_get ( funcs -> owner ) ) return - ENODEV ; client -> dev = dev ; client -> name = name ; client -> funcs = funcs ; ret = drm_client_open ( client ) ; if ( ret ) goto err_put_module ; drm_dev_get ( dev ) ; return 0 ; err_put_module : if ( funcs ) module_put ( funcs -> owner ) ; return ret ; }
drm_client_init - Initialise a DRM client
 @dev: DRM device
 @client: DRM client
 @name: Client name
 @funcs: DRM client functions (optional)
drm_client_init - Initialise a DRM client @dev : DRM device @client : DRM client @name : Client name @funcs : DRM client functions ( optional )