History log of /linux-master/net/devres.c
Revision Date Author Comments
# 51a1ebc3 10-Jun-2021 gushengxian <gushengxian@yulong.com>

net: devres: Correct a grammatical error

Correct a grammatical error.

Signed-off-by: gushengxian <gushengxian@yulong.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# fe189519 29-Jun-2020 Bartosz Golaszewski <bgolaszewski@baylibre.com>

net: devres: rename the release callback of devm_register_netdev()

Make it an explicit counterpart to devm_register_netdev() just like we
do with devm_free_netdev() for better clarity.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# cd16627f 23-May-2020 Bartosz Golaszewski <bgolaszewski@baylibre.com>

net: devres: provide devm_register_netdev()

Provide devm_register_netdev() - a device resource managed variant
of register_netdev(). This new helper will only work for net_device
structs that are also already managed by devres.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# f75063ab 23-May-2020 Bartosz Golaszewski <bgolaszewski@baylibre.com>

net: devres: define a separate devres structure for devm_alloc_etherdev()

Not using a proxy structure to store struct net_device doesn't save
anything in terms of compiled code size or memory usage but significantly
decreases the readability of the code with all the pointer casting.

Define struct net_device_devres and use it in devm_alloc_etherdev_mqs().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# cb8a14b2 23-May-2020 Bartosz Golaszewski <bgolaszewski@baylibre.com>

net: move devres helpers into a separate source file

There's currently only a single devres helper in net/ - devm variant
of alloc_etherdev. Let's move it to net/devres.c with the intention of
assing a second one: devm_register_netdev(). This new routine will need
to know the address of the release function of devm_alloc_etherdev() so
that it can verify (using devres_find()) that the struct net_device
that's being passed to it is also resource managed.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>