diff options
author | Takashi Iwai <tiwai@suse.de> | 2021-07-15 10:58:27 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-07-19 17:16:36 +0300 |
commit | 7835e0901e245aa8b83d7e2964f17088cb2e1f1e (patch) | |
tree | 419851236e88ba39c089447059d61ddae3ced3dd /Documentation/hwmon/max31785.rst | |
parent | ac327f1b10bca6cee8f1a427e5ba451e2d69c710 (diff) | |
download | linux-7835e0901e245aa8b83d7e2964f17088cb2e1f1e.tar.xz |
ALSA: intel8x0: Allocate resources with device-managed APIs
This patch refactors the intel8x0 and intel8x0m driver codes using
devres and gets rid of the driver remove callback.
The conversion is fairly straightforward: each API call is replaced
with the device-managed API function, e.g. pci_enable_device() ->
pcim_enable_device(), and so on. The buffer descriptor list is
allocated with a new API, snd_devm_alloc_pages().
A slight code structure change is that the intel8x0 object is
allocated as a card's private_data instead of the own lowlevel
snd_device object. This simplifies the resource management.
And, the take-down procedure is triggered via card->private_free, and
it's registered at the end of the whole initialization, i.e. after the
all resources get properly managed.
The only not-devres-managed resource is the irq handler. Since we
need to release at suspend and re-acquire at resume (otherwise
something weird happens on some machines), this is still managed
manually. But the rest are all freed automatically.
The end result is a good amount of code reduction.
Link: https://lore.kernel.org/r/20210715075941.23332-6-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'Documentation/hwmon/max31785.rst')
0 files changed, 0 insertions, 0 deletions