linux/drivers/media/mc/mc-devnode.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Media device node
 *
 * Copyright (C) 2010 Nokia Corporation
 *
 * Based on drivers/media/video/v4l2_dev.c code authored by
 *	Mauro Carvalho Chehab <[email protected]> (version 2)
 *	Alan Cox, <[email protected]> (version 1)
 *
 * Contacts: Laurent Pinchart <[email protected]>
 *	     Sakari Ailus <[email protected]>
 *
 * --
 *
 * Generic media device node infrastructure to register and unregister
 * character devices using a dynamic major number and proper reference
 * counting.
 */

#define pr_fmt(fmt)

#include <linux/errno.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/kmod.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/uaccess.h>

#include <media/media-devnode.h>
#include <media/media-device.h>

#define MEDIA_NUM_DEVICES
#define MEDIA_NAME

static dev_t media_dev_t;

/*
 *	Active devices
 */
static DEFINE_MUTEX(media_devnode_lock);
static DECLARE_BITMAP(media_devnode_nums, MEDIA_NUM_DEVICES);

/* Called when the last user of the media device exits. */
static void media_devnode_release(struct device *cd)
{}

static const struct bus_type media_bus_type =;

static ssize_t media_read(struct file *filp, char __user *buf,
		size_t sz, loff_t *off)
{}

static ssize_t media_write(struct file *filp, const char __user *buf,
		size_t sz, loff_t *off)
{}

static __poll_t media_poll(struct file *filp,
			       struct poll_table_struct *poll)
{}

static long
__media_ioctl(struct file *filp, unsigned int cmd, unsigned long arg,
	      long (*ioctl_func)(struct file *filp, unsigned int cmd,
				 unsigned long arg))
{}

static long media_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{}

#ifdef CONFIG_COMPAT

static long media_compat_ioctl(struct file *filp, unsigned int cmd,
			       unsigned long arg)
{}

#endif /* CONFIG_COMPAT */

/* Override for the open function */
static int media_open(struct inode *inode, struct file *filp)
{}

/* Override for the release function */
static int media_release(struct inode *inode, struct file *filp)
{}

static const struct file_operations media_devnode_fops =;

int __must_check media_devnode_register(struct media_device *mdev,
					struct media_devnode *devnode,
					struct module *owner)
{}

void media_devnode_unregister_prepare(struct media_devnode *devnode)
{}

void media_devnode_unregister(struct media_devnode *devnode)
{}

/*
 *	Initialise media for linux
 */
static int __init media_devnode_init(void)
{}

static void __exit media_devnode_exit(void)
{}

subsys_initcall(media_devnode_init);
module_exit()

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();