Messages in this thread | | | From | Andy Shevchenko <> | Date | Wed, 11 Nov 2020 17:02:09 +0200 | Subject | Re: [PATCH] gpiolib: devres: shrink devm_gpiochip_add_data_with_key() |
| |
On Tue, Nov 10, 2020 at 11:42 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote: > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com> > > If all we want to manage is a single pointer, there's no need to > manually allocate and add a new devres. We can simply use > devm_add_action_or_reset() and shrink the code by a good bit.
Yes, it is possible to convert all one-function-based devm_*() wrappers to use this approach.
The problem is, it will call the release() function on error which is new (and probably undesired) behaviour. I suppose you meant devm_add_action() here.
-- With Best Regards, Andy Shevchenko
| |