Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1373300
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 01/20] mfd: Add devm_ apis for mfd_add_devices and mfd_release_devices |
| Date | 2016-04-07 13:50 +0200 |
| Message-ID | <rlgBH-3br-1@gated-at.bofh.it> (permalink) |
| References | <rkxOi-2K6-21@gated-at.bofh.it> <rkxOk-2K6-55@gated-at.bofh.it> <rlfFE-2v3-13@gated-at.bofh.it> <rlfPj-2zu-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, 07 Apr 2016, Laxman Dewangan wrote:
> Hi Lee,
> Thanks for review.
> I will send another patch with incorporating your comments.
>
>
> On Thursday 07 April 2016 04:14 PM, Lee Jones wrote:
> >On Tue, 05 Apr 2016, Laxman Dewangan wrote:
> >
> >+ if (!ret) {
> >+ *ptr = dev;
> >+ devres_add(dev, ptr);
> >+ } else {
> >+ devres_free(ptr);
> >+ }
> >Switch these round. If you encounter a problem, free and return. If
> >not, skip the error handling and add the device outside of the if().
>
> Like below?
>
> if (ret) {
> devres_free(ptr);
> return ret;
> }
>
> *ptr = dev;
> devres_add(dev, ptr);
>
> return ret;
This is more in line with what I expect, yes.
> >>+ * Remove all mfd devices added on the device.
> >s/mfd/MFD/
> >
> >'D' already means devices, so here you are saying "devices devices".
> >Please re-word. Besides, you need to be more specific as to which
> >"devices on the devices" you are detailing, since this sentence
> >doesn't really make a great deal of sense.
> Wanted to say
> Remove all devices added by mfd_add_devices() from parent device.
Remove all chlid-devices?
> >>+ * Normally this function will not need to be called and the resource
> >>+ * management code will ensure that the resource is freed.
> >Then what is the purpose of providing it? Do you have a user?
>
> To have pair of release. I have not seen the usage of most of
> devm_*_release() function other than devm_kfree().
Unless you have a need or a user, I would omit this for now.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 01/20] mfd: Add devm_ apis for mfd_add_devices and mfd_release_devices Laxman Dewangan <ldewangan@nvidia.com> - 2016-04-05 14:00 +0200
Re: [PATCH 01/20] mfd: Add devm_ apis for mfd_add_devices and mfd_release_devices Lee Jones <lee.jones@linaro.org> - 2016-04-07 12:50 +0200
Re: [PATCH 01/20] mfd: Add devm_ apis for mfd_add_devices and mfd_release_devices Laxman Dewangan <ldewangan@nvidia.com> - 2016-04-07 13:00 +0200
Re: [PATCH 01/20] mfd: Add devm_ apis for mfd_add_devices and mfd_release_devices Lee Jones <lee.jones@linaro.org> - 2016-04-07 13:50 +0200
Re: [PATCH 01/20] mfd: Add devm_ apis for mfd_add_devices and mfd_release_devices Laxman Dewangan <ldewangan@nvidia.com> - 2016-04-07 14:00 +0200
csiph-web