Skip to content
Commit c0096a28 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'net-provide-a-devres-variant-of-register_netdev'



Bartosz Golaszewski says:

====================
net: provide a devres variant of register_netdev()

Using devres helpers allows to shrink the probing code, avoid memory leaks in
error paths make sure the order in which resources are freed is the exact
opposite of their allocation. This series proposes to add a devres variant
of register_netdev() that will only work with net_device structures whose
memory is also managed.

First we add the missing documentation entry for the only other networking
devres helper: devm_alloc_etherdev().

Next we move devm_alloc_etherdev() into a separate source file.

We then use a proxy structure in devm_alloc_etherdev() to improve readability.

Last: we implement devm_register_netdev() and use it in mtk-eth-mac driver.

v1 -> v2:
- rebase on top of net-next after driver rename, no functional changes
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 54b9aca0 9250dccc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment