lib: clock: return SUCCESS when the operation is a no-op#91
Merged
Conversation
Change the return value from ERR_ALREADY to SUCCESS for 3 cases in the clock service: * Setting the same rate on a clock * Disabling a disabled clock * Enabling an enabled clock This fixes a problem when enabling clocks already enabled by a prior boot stage with Linux (as Linux does not retrieve the current state before enabling a clock, resulting in ERR_ALREADY if the clock was already enabled). Fixes: b153230 ("lib: Implement clock infra and clock service group") Signed-off-by: Charles Perry <charles.perry@microchip.com>
There's no need for a special case for clocks with no child in the disable path and no parent in the enable path. Since childs/parents must be checked/enabled before taking care of the clock of interest in any case, some code duplication and a goto can be eliminated. Signed-off-by: Charles Perry <charles.perry@microchip.com>
Collaborator
|
Looks good to me |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First commit fixes a bug.
Second commit is a drive-by refactor.