On Mon, Jan 01, 2007 at 10:20:20PM +0200, Eli Billauer wrote:

> It seems like the kdev_t_to_nr macro has disappeared from the kernel 
> somewhere between 2.6.0 and now. There are also indications that saying
> 
> #define kdev_t_to_nr(x) (x)
> 
> is a good idea. Can anyone shed some light on this? Do I need to update 
> my module?

http://lwn.net/Articles/2.6-kernel-api/
http://lwn.net/Articles/driver-porting/

Specifically, see http://lwn.net/Articles/22196/

> For those interested, typical use of the macro for checking which minor 
> the inode was opened with:
> 
> static int frandom_open(struct inode *inode, struct file *filp)
> {
> 
>    struct frandom_state *state;
> 
>    int num =MINOR(kdev_t_to_nr(inode->i_rdev));
>    if ((num != frandom_minor) && (num != erandom_minor)) return
>    -ENODEV;

int num = iminor(inode); /* untested! */

Cheers,
Muli

---------------------------------------------------------------------
Haifa Linux Club Mailing List (http://www.haifux.org)
To unsub send an empty message to [EMAIL PROTECTED]

Reply via email to