diff options
author | Jakub Kicinski <kuba@kernel.org> | 2023-06-24 15:36:05 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-06-24 15:36:06 -0700 |
commit | c4015bbee9c0973fb98e2f357a20d1f8266bdf27 (patch) | |
tree | 5295885e3013570ede42316d7a6584d33746d595 /net/ieee802154/nl802154.c | |
parent | cfd40b82a50f8c7af7e18c4b207521f7bfce01dc (diff) | |
parent | 4194f32a4b2b1e41c00fac7a1f5f63375a94ba11 (diff) | |
download | linux-stable-c4015bbee9c0973fb98e2f357a20d1f8266bdf27.tar.gz linux-stable-c4015bbee9c0973fb98e2f357a20d1f8266bdf27.tar.bz2 linux-stable-c4015bbee9c0973fb98e2f357a20d1f8266bdf27.zip |
Merge branch 'net-stmmac-introduce-devres-helpers-for-stmmac-platform-drivers'
Bartosz Golaszewski says:
====================
net: stmmac: introduce devres helpers for stmmac platform drivers
The goal of this series is two-fold: to make the API for stmmac platforms more
logically correct (by providing functions that acquire resources with release
counterparts that undo only their actions and nothing more) and to provide
devres variants of commonly use registration functions that allows to
significantly simplify the platform drivers.
The current pattern for stmmac platform drivers is to call
stmmac_probe_config_dt(), possibly the platform's init() callback and then
call stmmac_drv_probe(). The resources allocated by these calls will then
be released by calling stmmac_pltfr_remove(). This goes against the commonly
accepted way of providing each function that allocated a resource with a
function that frees it.
First: provide wrappers around platform's init() and exit() callbacks that
allow users to skip checking if the callbacks exist manually.
Second: provide stmmac_pltfr_probe() which calls the platform init() callback
and then calls stmmac_drv_probe() together with a variant of
stmmac_pltfr_remove() that DOES NOT call stmmac_remove_config_dt(). For now
this variant is called stmmac_pltfr_remove_no_dt() but once all users of
the old stmmac_pltfr_remove() are converted to the devres helper, it will be
renamed back to stmmac_pltfr_remove() and the no_dt function removed.
Finally use the devres helpers in dwmac-qco-ethqos to show how much simplier
the driver's probe() becomes.
This series obviously just starts the conversion process and other platform
drivers will need to be converted once the helpers land in net/.
====================
Link: https://lore.kernel.org/r/20230623100417.93592-1-brgl@bgdev.pl
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ieee802154/nl802154.c')
0 files changed, 0 insertions, 0 deletions