Messages in this thread | | | Date | Thu, 15 May 2014 14:25:52 +0530 | Subject | Re: [PATCH] PM / OPP: discard duplicate OPP additions | From | Viresh Kumar <> |
| |
On 15 May 2014 14:16, Chander Kashyap <chander.kashyap@linaro.org> wrote: > Yes exactly. All users of this API need to be modified to handle > EEXIST as success.
There are very few:
arch/arm/mach-omap2/opp.c arch/arm/mach-vexpress/spc.c drivers/devfreq/exynos/exynos4_bus.c drivers/devfreq/exynos/exynos5_bus.c
So shouldn't be a problem fixing them..
> To avoid this returning 0 was suggested
But the bigger problem is that all new users have to know about this and must take care of it, would also result in code duplication.
So, if I think this way:
The purpose of dev_pm_opp_add() is to make sure the OPP is present with the device, when this function returns..
And with a duplicate entry, we can still confirm that. Over that, I couldn't think of any situation where the caller wants to react to -EXIST separately. They will still consider it as success.
So, maybe returning '0' isn't that bad of an idea :)
@Nishanth ?
| |