linux/drivers/media/mc/mc-dev-allocator.c

// SPDX-License-Identifier: GPL-2.0
/*
 * media-dev-allocator.c - Media Controller Device Allocator API
 *
 * Copyright (c) 2019 Shuah Khan <[email protected]>
 *
 * Credits: Suggested by Laurent Pinchart <[email protected]>
 */

/*
 * This file adds a global refcounted Media Controller Device Instance API.
 * A system wide global media device list is managed and each media device
 * includes a kref count. The last put on the media device releases the media
 * device instance.
 *
 */

#include <linux/kref.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/usb.h>

#include <media/media-device.h>
#include <media/media-dev-allocator.h>

static LIST_HEAD(media_device_list);
static DEFINE_MUTEX(media_device_lock);

struct media_device_instance {};

static inline struct media_device_instance *
to_media_device_instance(struct media_device *mdev)
{}

static void media_device_instance_release(struct kref *kref)
{}

/* Callers should hold media_device_lock when calling this function */
static struct media_device *__media_device_get(struct device *dev,
						const char *module_name,
						struct module *owner)
{}

struct media_device *media_device_usb_allocate(struct usb_device *udev,
					       const char *module_name,
					       struct module *owner)
{}
EXPORT_SYMBOL_GPL();

void media_device_delete(struct media_device *mdev, const char *module_name,
			 struct module *owner)
{}
EXPORT_SYMBOL_GPL();