summaryrefslogtreecommitdiffstats
path: root/net/devres.c
Commit message (Collapse)AuthorAgeFilesLines
* net: devres: rename the release callback of devm_register_netdev()Bartosz Golaszewski2020-06-301-2/+2
| | | | | | | | | 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>
* net: devres: provide devm_register_netdev()Bartosz Golaszewski2020-05-231-0/+55
| | | | | | | | | 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>
* net: devres: define a separate devres structure for devm_alloc_etherdev()Bartosz Golaszewski2020-05-231-8/+12
| | | | | | | | | | | 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>
* net: move devres helpers into a separate source fileBartosz Golaszewski2020-05-231-0/+36
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>