Re: [PATCH 2/2] New driver: Xillybus generic interface for FPGA(programmable logic)

From: Eli Billauer
Date: Sun Dec 02 2012 - 12:46:31 EST

On 11/30/2012 06:32 PM, Greg KH wrote:
> >>+static struct class *xillybus_class;
> >Why not just use the misc interface instead of your own class?
> When Xillybus is used, the whole system's mission is usually around
> it (e.g. it's a computer doing data acquisition through the Xillybus
> pipes). So giving it a high profile makes sense, I believe. Besides,
> a dozen of device files are not rare.
It is no problem to create dozens of misc devices. It makes your driver
smaller, contain less code that I have to audit and you have to ensure
you got right, and it removes another user of 'struct class' which we
are trying to get rid of anyway. So please, move to use a misc device.

It has just occurred to me that DYNAMIC_MINORS is 64 (drivers/char/misc.c), so I guess that limits the number of misc devices that can be generated, at least with dynamically allocated minors. I previously mentioned "a dozen" as the number of devices, but I've already run tests with 100+ devices, and I can also think of a sane application for that.

So if I understood the situation correctly, it looks like using misc devices will create a limitation which will be reached sooner or later.

Any suggestion what to do?

Thanks in advance,


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at