Commit 2bab8ae1 authored by Wesley W. Terpstra's avatar Wesley W. Terpstra

wishbone: increase hardware-specific module use count when device opened

parent 0b2501db
......@@ -254,6 +254,7 @@ static void wb_reply(struct wishbone *wb, int err, wb_data_t data)
}
static const struct wishbone_operations wb_ops = {
.owner = THIS_MODULE,
.cycle = wb_cycle,
.byteenable = wb_byteenable,
.write = wb_write,
......
......@@ -176,6 +176,7 @@ static void wb_reply(struct wishbone *wb, int err, wb_data_t dat)
}
static const struct wishbone_operations wb_ops = {
.owner = THIS_MODULE,
.cycle = wb_cycle,
.byteenable = wb_byteenable,
.write = wb_write,
......
......@@ -746,10 +746,10 @@ int wishbone_register(struct wishbone* wb)
/* Connect the file operations with the cdevs */
cdev_init(&wb->master_cdev, &etherbone_master_fops);
wb->master_cdev.owner = THIS_MODULE;
wb->master_cdev.owner = wb->wops->owner;
cdev_init(&wb->slave_cdev, &etherbone_slave_fops);
wb->slave_cdev.owner = THIS_MODULE;
wb->slave_cdev.owner = wb->wops->owner;
wb->master_dev =
MKDEV(
......
......@@ -36,6 +36,9 @@ struct wishbone_request
struct wishbone_operations
{
/* owning module */
struct module *owner;
/* master operations */
void (*cycle)(struct wishbone *wb, int on);
void (*byteenable)(struct wishbone *wb, unsigned char mask);
......
......@@ -208,6 +208,7 @@ static void wb_byteenable(struct wishbone *wb, unsigned char be)
}
static const struct wishbone_operations wb_ops = {
.owner = THIS_MODULE,
.cycle = wb_cycle,
.byteenable = wb_byteenable,
.write = wb_write,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment