[Cbe-oss-dev] [PATCH] axonram: 1st version
Christoph Hellwig
hch at lst.de
Fri Feb 16 04:46:12 EST 2007
On Wed, Feb 14, 2007 at 11:21:52PM +0100, Maxim Shchetynin wrote:
> > > +struct axon_ram_bank {
> > > + char chrdev_name[DEVICE_NAME_SIZE];
> > > + char blkdev_name[DEVICE_NAME_SIZE];
> > > + rwlock_t lock;
> > > + phys_addr_t phys_addr;
> > > + void __iomem *addr;
> > > + size_t size;
> > > + struct gendisk *disk;
> > > + struct miscdevice misc;
> > > + struct file_operations fops;
> >
> > We shouldn't need per-instance file operations and miscdevice One global
> > is enough, like most drivers do.
>
> I need both. I need one miscdevice per device because their minors are
> stored here and I need minors in axon_ram_remove(). And I need one
> file_operation per device because this is the only easier way to get
> pointer to struct axon_ram_bank in axon_ram_open() for character device.
Getting the point this way is a hack you won't get into mainline, sorry
:)
And instead of using multiple miscdevice you should simply grab yourself
a major and manage it's minors in the driver.
Then again life would be a lot ismpler if e just killed the chardev
and purely used the block device.
More information about the cbe-oss-dev
mailing list