diff options
author | Thierry Reding <treding@nvidia.com> | 2015-08-04 09:25:03 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2015-08-13 10:49:58 -0400 |
commit | 592431b0369dc7a1f4a68f15ff0c48d94b66297f (patch) | |
tree | 5c5d874ffd2f531ee1f21aab7ed6371537e7de65 /drivers/soc | |
parent | 4a4466a6a418b96d6cb07ffb46cefa13df8f12ef (diff) |
soc/tegra: pmc: Use existing pclk reference
The driver requests the pclk clock at probe time already and stores its
reference to it in struct tegra_pmc, so there is no need to look it up
everytime it is needed. Use the existing reference instead.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/tegra/pmc.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 0add31180096..bc34cf7482fb 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c | |||
@@ -459,7 +459,6 @@ static int tegra_io_rail_prepare(int id, unsigned long *request, | |||
459 | unsigned long *status, unsigned int *bit) | 459 | unsigned long *status, unsigned int *bit) |
460 | { | 460 | { |
461 | unsigned long rate, value; | 461 | unsigned long rate, value; |
462 | struct clk *clk; | ||
463 | 462 | ||
464 | *bit = id % 32; | 463 | *bit = id % 32; |
465 | 464 | ||
@@ -478,12 +477,7 @@ static int tegra_io_rail_prepare(int id, unsigned long *request, | |||
478 | *request = IO_DPD2_REQ; | 477 | *request = IO_DPD2_REQ; |
479 | } | 478 | } |
480 | 479 | ||
481 | clk = clk_get_sys(NULL, "pclk"); | 480 | rate = clk_get_rate(pmc->clk); |
482 | if (IS_ERR(clk)) | ||
483 | return PTR_ERR(clk); | ||
484 | |||
485 | rate = clk_get_rate(clk); | ||
486 | clk_put(clk); | ||
487 | 481 | ||
488 | tegra_pmc_writel(DPD_SAMPLE_ENABLE, DPD_SAMPLE); | 482 | tegra_pmc_writel(DPD_SAMPLE_ENABLE, DPD_SAMPLE); |
489 | 483 | ||
@@ -537,8 +531,10 @@ int tegra_io_rail_power_on(int id) | |||
537 | tegra_pmc_writel(value, request); | 531 | tegra_pmc_writel(value, request); |
538 | 532 | ||
539 | err = tegra_io_rail_poll(status, mask, 0, 250); | 533 | err = tegra_io_rail_poll(status, mask, 0, 250); |
540 | if (err < 0) | 534 | if (err < 0) { |
535 | pr_info("tegra_io_rail_poll() failed: %d\n", err); | ||
541 | return err; | 536 | return err; |
537 | } | ||
542 | 538 | ||
543 | tegra_io_rail_unprepare(); | 539 | tegra_io_rail_unprepare(); |
544 | 540 | ||
@@ -553,8 +549,10 @@ int tegra_io_rail_power_off(int id) | |||
553 | int err; | 549 | int err; |
554 | 550 | ||
555 | err = tegra_io_rail_prepare(id, &request, &status, &bit); | 551 | err = tegra_io_rail_prepare(id, &request, &status, &bit); |
556 | if (err < 0) | 552 | if (err < 0) { |
553 | pr_info("tegra_io_rail_prepare() failed: %d\n", err); | ||
557 | return err; | 554 | return err; |
555 | } | ||
558 | 556 | ||
559 | mask = 1 << bit; | 557 | mask = 1 << bit; |
560 | 558 | ||