#include <linux/fs.h>
#include <linux/init.h>
#include <linux/leds.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/poll.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <uapi/linux/uleds.h>
#define ULEDS_NAME …
enum uleds_state { … };
struct uleds_device { … };
static struct miscdevice uleds_misc;
static void uleds_brightness_set(struct led_classdev *led_cdev,
enum led_brightness brightness)
{ … }
static int uleds_open(struct inode *inode, struct file *file)
{ … }
static ssize_t uleds_write(struct file *file, const char __user *buffer,
size_t count, loff_t *ppos)
{ … }
static ssize_t uleds_read(struct file *file, char __user *buffer, size_t count,
loff_t *ppos)
{ … }
static __poll_t uleds_poll(struct file *file, poll_table *wait)
{ … }
static int uleds_release(struct inode *inode, struct file *file)
{ … }
static const struct file_operations uleds_fops = …;
static struct miscdevice uleds_misc = …;
module_misc_device(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;