Re: SET_MODULE_OWNER?

Rusty Russell (rusty@rustcorp.com.au)
Tue, 08 Apr 2003 13:41:12 +1000


In message <Pine.LNX.4.50.0304072212310.21025-100000@montezuma.mastecende.com>
you write:
> (e.g. pci-dma api changes). Regardless, here is a typical use in a
> netdriver.
>
> /* dev and dev->priv zeroed in alloc_etherdev */
> dev = alloc_etherdev (sizeof (*tp));
> if (dev == NULL) {
> printk (KERN_ERR PFX "%s: Unable to alloc new net device\n", pd
ev->slot_name);
> return -ENOMEM;
> }
> SET_MODULE_OWNER(dev);
> tp = dev->priv;
>
> /* followed by ... */
> dev->foo = __foo;
> dev->bar = __bar;

I don't understand how that helps compatibility over:

dev->owner = THIS_MODULE;

Both will:
1) Work on 2.4 and 2.5
2) Break on 2.2.

Confused,
Rusty.

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/