Subject: Re: [PATCH net-next] ptp: dynamic allocation of PHC char devices

From: Jiri Benc <[email-masked]>
Date: Thu, 11 Apr 2013 11:52:01 +0200

On Wed, 10 Apr 2013 19:12:39 +0100, Ben Hutchings wrote:
> On Wed, 2013-04-10 at 13:49 -0400, David Miller wrote:
> > Can't multiple (unrelated) devices carve out minor space in the same
> > major?  Isn't that why it's designed this way?
> 
> Only at a level above the core char device functions, e.g.
> misc_register() for singleton devices.  Unless I'm very much mistaken,
> when you allocate a char device range and specify major=0 you get a
> dynamically allocated and previously unused major, regardless of how
> many minors you asked for.

You're correct. And thinking about it, I indeed see no reason not to
allocate the full range. We save some memory that way, as each minor
range allocation is tracked by register_chrdev_region, and the code is
going to be simpler.

I'll respin the patch.

Thanks,

 Jiri