summaryrefslogtreecommitdiffstats
path: root/drivers/most/most_cdev.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-09-13 12:27:00 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-09-13 12:27:00 -0700
commit22098763a10d9c1340827fcf6edab66f153b27f0 (patch)
tree3962f95a34df034652ff93686cdd156c7197f2d9 /drivers/most/most_cdev.c
downloadlinux-stable-22098763a10d9c1340827fcf6edab66f153b27f0.tar.gz
linux-stable-22098763a10d9c1340827fcf6edab66f153b27f0.zip
Merge tag 'trace-v7.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-tracegrafted
Pull tracing fixes from Steven Rostedt: - Don't destroy user event fields when removal fails User event fields are destroyed before the event is removed from visibility. But that can fail leaving the still visible event with no fields. Move the destroying of the fields to after the event is successfully removed from visibility. - Initialize function graph state is fork before calling copy_exec_state() For non-CLONE_VM forks, copy_exec_state() allocates a new task_exec_state. If that allocation fails, ftrace_graph_exit_task() will free the tasks ret_stack pointer. Since that pointer is still using the parent's ret_stack, it mistakenly frees the parent's pointer too. Call ftrace_graph_init() on the task first which will NULL out the new tasks's ret_stack and if the copy fails, it will not free anything. - Remove FGRAPH_MAX_INDEX The macro FGRAPH_MAX_INDEX was added but never used. Remove it. - Save ent_size in function graph printing of nested functions The function graph tracer needs to look at the next event to see if the next event is the return of the current function entry. If it is, it prints a single line: ktime_get(); Otherwise it prints it like a nested function: tick_nohz_irq_exit() { ktime_get(); kcpustat_irq_exit(); } In order to look at the next event, it must save the current event so that it has the information to print from it. It saves the event in the iterator descriptor called "ent". What it doesn't save is the ent_size of the event which is now used to know if the function graph arguments are to be printed. The peek doesn't save the size so the size used happens to be that of the size of the last event that was seen. Save the entry event size in the iterator descriptor so that the correct size is used. - Fix several errors with freeing data in the histogram code The histogram code had a lot of leaked or or incorrect accounting when failures happen. Correct them. - Fix histogram regression of .percent and .graph modifiers Up until 6.3 histogram values could have "percent" or "graph" modifiers that changed how they were printed. But a change that added restricting histograms values from being strings, stack traces and other modifiers inadvertently prevented them from using the percent and graph modifiers, which were legal use cases for values. Put back the percent and graph modifiers. - Fix various typos in the comments - Set the trace_clock before initializing a histogram with clock argument The histogram API allows the user to specific which trace clock to use via a "clock=" string. The histogram is set up first before the clock is checked. If the passed in clock is not valid, it exits without fully fixing up the histogram leaving it on the list and a use-after-free can trigger. Update the clock argument first and if it fails then exit gracefully before the histogram trigger is placed on any lists. - Restore :mod: trailer after parsing in ftrace_set_clr_event The function ftrace_set_clr_event() modifies the parse string and needs to put it back to what was passed in. It searches for ":mod:" via a strsep() but fails to put back the first ':' in the string. Add back the ':' in the passed in string. - Take trace_array reference when opening a tracer options file The options files are dynamically created and some tracers add their own options. When a tracer adds their own list of options, the trace_array holding them has an array to hold the list of options for each tracer. This array increases in size via a krealloc(), and the new entry gets a newly allocated array to hold the options of the new tracer being added. The element in each entry of the tracer's option array holds a pointer back to the trace_array, a pointer to the tracer it is associated to, a pointer to the flags of the option. The issue is that these arrays are freed when the trace_array is freed when its instance it represents is removed from the instances directory. There's a race that an open of one of these options files can happen when the instance is being removed. Add a new helper function to be called by the open function of the options file to iterate all existing trace_arrays under a lock and find the one that has the given option element in one of it's tracer arrays. If found, then update the associated trace_array's reference counter to keep it from being freed. If not found, have the open call return -ENODEV. - Disable interrupts when acquiring the lock in rb_wake_up_waiters() The function rb_wake_up_waiters() assumes it will be called in interrupt context and does not disable irqs when taking cpu_buffer->reader_lock, which can be called in hard interrupt context. The issue is in PREEMPT_RT, this function is called in thread context leaving this lock open to a deadlock. Take the lock with interrupts disabled. - Use rcu_assign_pointer() for tmp_ops filter hash The tmp_ops used in update_ftrace_direct_mod() assigns its filter_hash field directly, but that field is annotated as __rcu and sparse complains. Assign it with rcu_assign_pointer() - Fix use-after-free in enable_trigger_private_data_free() The trace_event_call is accessed through the event_trigger_data's trace_event_file pointer to put the trace_event_call on freeing. The issue is that the trace_event_file data may have been freed already causing a use-after-free. Add a field to the event_trigger_data that points directly to the trace_event_call so that it can decrement its reference directly without needing to go through the trace_event_file. - Fix accounting of buffer data remote headers trace_buffer_desc_size() and trace_remote_alloc_buffer() undercount the number of pages is needed for the asked for size as it doesn't take into account the meta data on each page. Add a helper function to do the calculation properly and use that in these functions. - Catch nr_page_va overflow in ring_buffer_desc sizing The number of pages per remote ring buffer is capped by ring_buffer_desc::nr_page_va (32 bits). A buffer_size large enough to overflow that field would silently allocate a descriptor smaller than what was asked for. - Do not resize the subbuf order if any per_cpu buffer is disabled The mmapping of ring buffers disables resizing the subbuffers, but it is done per-cpu whereas the subbuf size change is done for all the per_cpu buffers under the buffer->mutex. It could change the size of some while the mapping is happening on others. Have the resize of the subbuf order check all the per_cpu buffers under the lock to see if any of them is disabled before starting and causing an inconsistency between buffers that are being mapped. * tag 'trace-v7.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: (25 commits) ring-buffer: Check resize_disabled before publishing the new subbuf order tracing/remotes: Catch nr_page_va overflow in ring_buffer_desc sizing tracing/remotes: Account for ring buffer page header in size calculation tracing: Don't dereference trace_event_file in deferred trigger free ftrace: Use rcu_assign_pointer() for tmp_ops filter hash ring-buffer: Acquire the lock with irqsave in rb_wake_up_waiters() tracing: Take trace_array reference when opening a tracer options file tracing: Fix ring_buffer_read_page_size() kernel-doc tracing: Restore :mod: trailer after parsing in ftrace_set_clr_event() tracing: Fix memory corruption from a "STACKTRACE" histogram key tracing: Fix memory corruption from the histogram stacktrace modifier tracing: Undo the registration when enabling the histogram trigger fails tracing: Take the reference before publishing the named histogram trigger tracing: Set the trace clock before registering the histogram trigger tracing: Fix typo "preceeded" in comment tracing: Fix typo "availabe" in comment tracing: Let histogram values keep the percent and graph modifiers tracing: Keep the entry count when the histogram stats allocation fails tracing: Free histogram the field rejected for a bad modifier tracing: Free histogram the var ref when its initialization fails ...
Diffstat (limited to 'drivers/most/most_cdev.c')
-rw-r--r--drivers/most/most_cdev.c546
1 files changed, 546 insertions, 0 deletions
diff --git a/drivers/most/most_cdev.c b/drivers/most/most_cdev.c
new file mode 100644
index 000000000..5df508d8d
--- /dev/null
+++ b/drivers/most/most_cdev.c
@@ -0,0 +1,546 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * cdev.c - Character device component for Mostcore
+ *
+ * Copyright (C) 2013-2015 Microchip Technology Germany II GmbH & Co. KG
+ */
+
+#include <linux/module.h>
+#include <linux/sched.h>
+#include <linux/fs.h>
+#include <linux/slab.h>
+#include <linux/device.h>
+#include <linux/cdev.h>
+#include <linux/poll.h>
+#include <linux/kfifo.h>
+#include <linux/uaccess.h>
+#include <linux/idr.h>
+#include <linux/most.h>
+
+#define CHRDEV_REGION_SIZE 50
+
+static const struct class most_cdev_class = {
+ .name = "most_cdev"
+};
+
+static struct cdev_component {
+ dev_t devno;
+ struct ida minor_id;
+ unsigned int major;
+ struct most_component cc;
+} comp;
+
+struct comp_channel {
+ wait_queue_head_t wq;
+ spinlock_t unlink; /* synchronization lock to unlink channels */
+ struct cdev cdev;
+ struct device *dev;
+ struct mutex io_mutex;
+ struct most_interface *iface;
+ struct most_channel_config *cfg;
+ unsigned int channel_id;
+ dev_t devno;
+ size_t mbo_offs;
+ DECLARE_KFIFO_PTR(fifo, typeof(struct mbo *));
+ int access_ref;
+ struct list_head list;
+};
+
+#define to_channel(d) container_of(d, struct comp_channel, cdev)
+static LIST_HEAD(channel_list);
+static DEFINE_SPINLOCK(ch_list_lock);
+
+static inline bool ch_has_mbo(struct comp_channel *c)
+{
+ return channel_has_mbo(c->iface, c->channel_id, &comp.cc) > 0;
+}
+
+static inline struct mbo *ch_get_mbo(struct comp_channel *c, struct mbo **mbo)
+{
+ if (!kfifo_peek(&c->fifo, mbo)) {
+ *mbo = most_get_mbo(c->iface, c->channel_id, &comp.cc);
+ if (*mbo)
+ kfifo_in(&c->fifo, mbo, 1);
+ }
+ return *mbo;
+}
+
+static struct comp_channel *get_channel(struct most_interface *iface, int id)
+{
+ struct comp_channel *c, *tmp;
+ unsigned long flags;
+
+ spin_lock_irqsave(&ch_list_lock, flags);
+ list_for_each_entry_safe(c, tmp, &channel_list, list) {
+ if ((c->iface == iface) && (c->channel_id == id)) {
+ spin_unlock_irqrestore(&ch_list_lock, flags);
+ return c;
+ }
+ }
+ spin_unlock_irqrestore(&ch_list_lock, flags);
+ return NULL;
+}
+
+static void stop_channel(struct comp_channel *c)
+{
+ struct mbo *mbo;
+
+ while (kfifo_out((struct kfifo *)&c->fifo, &mbo, 1))
+ most_put_mbo(mbo);
+ most_stop_channel(c->iface, c->channel_id, &comp.cc);
+}
+
+static void destroy_cdev(struct comp_channel *c)
+{
+ unsigned long flags;
+
+ device_destroy(&most_cdev_class, c->devno);
+ cdev_del(&c->cdev);
+ spin_lock_irqsave(&ch_list_lock, flags);
+ list_del(&c->list);
+ spin_unlock_irqrestore(&ch_list_lock, flags);
+}
+
+static void destroy_channel(struct comp_channel *c)
+{
+ ida_free(&comp.minor_id, MINOR(c->devno));
+ kfifo_free(&c->fifo);
+ kfree(c);
+}
+
+/**
+ * comp_open - implements the syscall to open the device
+ * @inode: inode pointer
+ * @filp: file pointer
+ *
+ * This stores the channel pointer in the private data field of
+ * the file structure and activates the channel within the core.
+ */
+static int comp_open(struct inode *inode, struct file *filp)
+{
+ struct comp_channel *c;
+ int ret;
+
+ c = to_channel(inode->i_cdev);
+ filp->private_data = c;
+
+ if (((c->cfg->direction == MOST_CH_RX) &&
+ ((filp->f_flags & O_ACCMODE) != O_RDONLY)) ||
+ ((c->cfg->direction == MOST_CH_TX) &&
+ ((filp->f_flags & O_ACCMODE) != O_WRONLY))) {
+ return -EACCES;
+ }
+
+ mutex_lock(&c->io_mutex);
+ if (!c->dev) {
+ mutex_unlock(&c->io_mutex);
+ return -ENODEV;
+ }
+
+ if (c->access_ref) {
+ mutex_unlock(&c->io_mutex);
+ return -EBUSY;
+ }
+
+ c->mbo_offs = 0;
+ ret = most_start_channel(c->iface, c->channel_id, &comp.cc);
+ if (!ret)
+ c->access_ref = 1;
+ mutex_unlock(&c->io_mutex);
+ return ret;
+}
+
+/**
+ * comp_close - implements the syscall to close the device
+ * @inode: inode pointer
+ * @filp: file pointer
+ *
+ * This stops the channel within the core.
+ */
+static int comp_close(struct inode *inode, struct file *filp)
+{
+ struct comp_channel *c = to_channel(inode->i_cdev);
+
+ mutex_lock(&c->io_mutex);
+ spin_lock(&c->unlink);
+ c->access_ref = 0;
+ spin_unlock(&c->unlink);
+ if (c->dev) {
+ stop_channel(c);
+ mutex_unlock(&c->io_mutex);
+ } else {
+ mutex_unlock(&c->io_mutex);
+ destroy_channel(c);
+ }
+ return 0;
+}
+
+/**
+ * comp_write - implements the syscall to write to the device
+ * @filp: file pointer
+ * @buf: pointer to user buffer
+ * @count: number of bytes to write
+ * @offset: offset from where to start writing
+ */
+static ssize_t comp_write(struct file *filp, const char __user *buf,
+ size_t count, loff_t *offset)
+{
+ int ret;
+ size_t to_copy, left;
+ struct mbo *mbo = NULL;
+ struct comp_channel *c = filp->private_data;
+
+ mutex_lock(&c->io_mutex);
+ while (c->dev && !ch_get_mbo(c, &mbo)) {
+ mutex_unlock(&c->io_mutex);
+
+ if ((filp->f_flags & O_NONBLOCK))
+ return -EAGAIN;
+ if (wait_event_interruptible(c->wq, ch_has_mbo(c) || !c->dev))
+ return -ERESTARTSYS;
+ mutex_lock(&c->io_mutex);
+ }
+
+ if (unlikely(!c->dev)) {
+ ret = -ENODEV;
+ goto unlock;
+ }
+
+ to_copy = min(count, c->cfg->buffer_size - c->mbo_offs);
+ left = copy_from_user(mbo->virt_address + c->mbo_offs, buf, to_copy);
+ if (left == to_copy) {
+ ret = -EFAULT;
+ goto unlock;
+ }
+
+ c->mbo_offs += to_copy - left;
+ if (c->mbo_offs >= c->cfg->buffer_size ||
+ c->cfg->data_type == MOST_CH_CONTROL ||
+ c->cfg->data_type == MOST_CH_ASYNC) {
+ kfifo_skip(&c->fifo);
+ mbo->buffer_length = c->mbo_offs;
+ c->mbo_offs = 0;
+ most_submit_mbo(mbo);
+ }
+
+ ret = to_copy - left;
+unlock:
+ mutex_unlock(&c->io_mutex);
+ return ret;
+}
+
+/**
+ * comp_read - implements the syscall to read from the device
+ * @filp: file pointer
+ * @buf: pointer to user buffer
+ * @count: number of bytes to read
+ * @offset: offset from where to start reading
+ */
+static ssize_t
+comp_read(struct file *filp, char __user *buf, size_t count, loff_t *offset)
+{
+ size_t to_copy, not_copied, copied;
+ struct mbo *mbo = NULL;
+ struct comp_channel *c = filp->private_data;
+
+ mutex_lock(&c->io_mutex);
+ while (c->dev && !kfifo_peek(&c->fifo, &mbo)) {
+ mutex_unlock(&c->io_mutex);
+ if (filp->f_flags & O_NONBLOCK)
+ return -EAGAIN;
+ if (wait_event_interruptible(c->wq,
+ (!kfifo_is_empty(&c->fifo) ||
+ (!c->dev))))
+ return -ERESTARTSYS;
+ mutex_lock(&c->io_mutex);
+ }
+
+ /* make sure we don't submit to gone devices */
+ if (unlikely(!c->dev)) {
+ mutex_unlock(&c->io_mutex);
+ return -ENODEV;
+ }
+
+ to_copy = min_t(size_t,
+ count,
+ mbo->processed_length - c->mbo_offs);
+
+ not_copied = copy_to_user(buf,
+ mbo->virt_address + c->mbo_offs,
+ to_copy);
+
+ copied = to_copy - not_copied;
+
+ c->mbo_offs += copied;
+ if (c->mbo_offs >= mbo->processed_length) {
+ kfifo_skip(&c->fifo);
+ most_put_mbo(mbo);
+ c->mbo_offs = 0;
+ }
+ mutex_unlock(&c->io_mutex);
+ return copied;
+}
+
+static __poll_t comp_poll(struct file *filp, poll_table *wait)
+{
+ struct comp_channel *c = filp->private_data;
+ __poll_t mask = 0;
+
+ poll_wait(filp, &c->wq, wait);
+
+ mutex_lock(&c->io_mutex);
+ if (c->cfg->direction == MOST_CH_RX) {
+ if (!c->dev || !kfifo_is_empty(&c->fifo))
+ mask |= EPOLLIN | EPOLLRDNORM;
+ } else {
+ if (!c->dev || !kfifo_is_empty(&c->fifo) || ch_has_mbo(c))
+ mask |= EPOLLOUT | EPOLLWRNORM;
+ }
+ mutex_unlock(&c->io_mutex);
+ return mask;
+}
+
+/*
+ * Initialization of struct file_operations
+ */
+static const struct file_operations channel_fops = {
+ .owner = THIS_MODULE,
+ .read = comp_read,
+ .write = comp_write,
+ .open = comp_open,
+ .release = comp_close,
+ .poll = comp_poll,
+};
+
+/**
+ * comp_disconnect_channel - disconnect a channel
+ * @iface: pointer to interface instance
+ * @channel_id: channel index
+ *
+ * This frees allocated memory and removes the cdev that represents this
+ * channel in user space.
+ */
+static int comp_disconnect_channel(struct most_interface *iface, int channel_id)
+{
+ struct comp_channel *c;
+
+ c = get_channel(iface, channel_id);
+ if (!c)
+ return -EINVAL;
+
+ mutex_lock(&c->io_mutex);
+ spin_lock(&c->unlink);
+ c->dev = NULL;
+ spin_unlock(&c->unlink);
+ destroy_cdev(c);
+ if (c->access_ref) {
+ stop_channel(c);
+ wake_up_interruptible(&c->wq);
+ mutex_unlock(&c->io_mutex);
+ } else {
+ mutex_unlock(&c->io_mutex);
+ destroy_channel(c);
+ }
+ return 0;
+}
+
+/**
+ * comp_rx_completion - completion handler for rx channels
+ * @mbo: pointer to buffer object that has completed
+ *
+ * This searches for the channel linked to this MBO and stores it in the local
+ * fifo buffer.
+ */
+static int comp_rx_completion(struct mbo *mbo)
+{
+ struct comp_channel *c;
+
+ if (!mbo)
+ return -EINVAL;
+
+ c = get_channel(mbo->ifp, mbo->hdm_channel_id);
+ if (!c)
+ return -EINVAL;
+
+ spin_lock(&c->unlink);
+ if (!c->access_ref || !c->dev) {
+ spin_unlock(&c->unlink);
+ return -ENODEV;
+ }
+ kfifo_in(&c->fifo, &mbo, 1);
+ spin_unlock(&c->unlink);
+#ifdef DEBUG_MESG
+ if (kfifo_is_full(&c->fifo))
+ dev_warn(c->dev, "Fifo is full\n");
+#endif
+ wake_up_interruptible(&c->wq);
+ return 0;
+}
+
+/**
+ * comp_tx_completion - completion handler for tx channels
+ * @iface: pointer to interface instance
+ * @channel_id: channel index/ID
+ *
+ * This wakes sleeping processes in the wait-queue.
+ */
+static int comp_tx_completion(struct most_interface *iface, int channel_id)
+{
+ struct comp_channel *c;
+
+ c = get_channel(iface, channel_id);
+ if (!c)
+ return -EINVAL;
+
+ if ((channel_id < 0) || (channel_id >= iface->num_channels)) {
+ dev_warn(c->dev, "Channel ID out of range\n");
+ return -EINVAL;
+ }
+
+ wake_up_interruptible(&c->wq);
+ return 0;
+}
+
+/**
+ * comp_probe - probe function of the driver module
+ * @iface: pointer to interface instance
+ * @channel_id: channel index/ID
+ * @cfg: pointer to actual channel configuration
+ * @name: name of the device to be created
+ * @args: pointer to array of component parameters (from configfs)
+ *
+ * This allocates a channel object and creates the device node in /dev
+ *
+ * Returns 0 on success or error code otherwise.
+ */
+static int comp_probe(struct most_interface *iface, int channel_id,
+ struct most_channel_config *cfg, char *name, char *args)
+{
+ struct comp_channel *c;
+ unsigned long cl_flags;
+ int retval;
+ int current_minor;
+
+ if (!cfg || !name)
+ return -EINVAL;
+
+ c = get_channel(iface, channel_id);
+ if (c)
+ return -EEXIST;
+
+ current_minor = ida_alloc(&comp.minor_id, GFP_KERNEL);
+ if (current_minor < 0)
+ return current_minor;
+
+ c = kzalloc_obj(*c);
+ if (!c) {
+ retval = -ENOMEM;
+ goto err_remove_ida;
+ }
+
+ c->devno = MKDEV(comp.major, current_minor);
+ cdev_init(&c->cdev, &channel_fops);
+ c->cdev.owner = THIS_MODULE;
+ retval = cdev_add(&c->cdev, c->devno, 1);
+ if (retval < 0)
+ goto err_free_c;
+ c->iface = iface;
+ c->cfg = cfg;
+ c->channel_id = channel_id;
+ c->access_ref = 0;
+ spin_lock_init(&c->unlink);
+ INIT_KFIFO(c->fifo);
+ retval = kfifo_alloc(&c->fifo, cfg->num_buffers, GFP_KERNEL);
+ if (retval)
+ goto err_del_cdev_and_free_channel;
+ init_waitqueue_head(&c->wq);
+ mutex_init(&c->io_mutex);
+ spin_lock_irqsave(&ch_list_lock, cl_flags);
+ list_add_tail(&c->list, &channel_list);
+ spin_unlock_irqrestore(&ch_list_lock, cl_flags);
+ c->dev = device_create(&most_cdev_class, NULL, c->devno, NULL, "%s", name);
+
+ if (IS_ERR(c->dev)) {
+ retval = PTR_ERR(c->dev);
+ goto err_free_kfifo_and_del_list;
+ }
+ kobject_uevent(&c->dev->kobj, KOBJ_ADD);
+ return 0;
+
+err_free_kfifo_and_del_list:
+ kfifo_free(&c->fifo);
+ list_del(&c->list);
+err_del_cdev_and_free_channel:
+ cdev_del(&c->cdev);
+err_free_c:
+ kfree(c);
+err_remove_ida:
+ ida_free(&comp.minor_id, current_minor);
+ return retval;
+}
+
+static struct cdev_component comp = {
+ .cc = {
+ .mod = THIS_MODULE,
+ .name = "cdev",
+ .probe_channel = comp_probe,
+ .disconnect_channel = comp_disconnect_channel,
+ .rx_completion = comp_rx_completion,
+ .tx_completion = comp_tx_completion,
+ },
+};
+
+
+static int __init most_cdev_init(void)
+{
+ int err;
+
+ err = class_register(&most_cdev_class);
+ if (err)
+ return err;
+
+ ida_init(&comp.minor_id);
+
+ err = alloc_chrdev_region(&comp.devno, 0, CHRDEV_REGION_SIZE, "cdev");
+ if (err < 0)
+ goto dest_ida;
+ comp.major = MAJOR(comp.devno);
+ err = most_register_component(&comp.cc);
+ if (err)
+ goto free_cdev;
+ err = most_register_configfs_subsys(&comp.cc);
+ if (err)
+ goto deregister_comp;
+ return 0;
+
+deregister_comp:
+ most_deregister_component(&comp.cc);
+free_cdev:
+ unregister_chrdev_region(comp.devno, CHRDEV_REGION_SIZE);
+dest_ida:
+ ida_destroy(&comp.minor_id);
+ class_unregister(&most_cdev_class);
+ return err;
+}
+
+static void __exit most_cdev_exit(void)
+{
+ struct comp_channel *c, *tmp;
+
+ most_deregister_configfs_subsys(&comp.cc);
+ most_deregister_component(&comp.cc);
+
+ list_for_each_entry_safe(c, tmp, &channel_list, list) {
+ destroy_cdev(c);
+ destroy_channel(c);
+ }
+ unregister_chrdev_region(comp.devno, CHRDEV_REGION_SIZE);
+ ida_destroy(&comp.minor_id);
+ class_unregister(&most_cdev_class);
+}
+
+module_init(most_cdev_init);
+module_exit(most_cdev_exit);
+MODULE_AUTHOR("Christian Gromm <christian.gromm@microchip.com>");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("character device component for mostcore");