soc/tegra: pmc: Ensure mutex is always initialised
authorJon Hunter <jonathanh@nvidia.com>
Tue, 28 Jun 2016 10:38:26 +0000 (11:38 +0100)
committerThierry Reding <treding@nvidia.com>
Thu, 30 Jun 2016 10:23:07 +0000 (12:23 +0200)
commit61fd284be8be06db1339ca4c9217f5a13b50074f
treeb9fd610f396fe04a31fec4d33388984f7856f992
parent718a2426e82076e4eddc2a041c8e944c9f9b3e61
soc/tegra: pmc: Ensure mutex is always initialised

The mutex used by the PMC driver may not be initialised if early
initialisation of the driver fails. If this does happen, then it could
be possible for callers of the public PMC functions to still attempt to
acquire the mutex. Fix this by initialising the mutex as soon as
possible to ensure it will always be initialised.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/soc/tegra/pmc.c