diff options
| author | Laxman Dewangan <ldewangan@nvidia.com> | 2016-07-04 04:49:40 -0400 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-07-04 13:02:49 -0400 |
| commit | 174159ea8ffda4b29fa7cbf37b96fe0b6014b8eb (patch) | |
| tree | a5e12b0e5fc0cb818fa7139d5474625f646fffa5 | |
| parent | 36cab2dc13b685a86d7a0d493f35a7c5a97bd0e3 (diff) | |
platform: tegra_prod: Get rid of tegra_prod_release()
The new API added for releasing the tegra_prod handle as
tegra_prod_put() which match with tegra_prod_get().
Hence remove the need of tegra_prod_release().
Change-Id: I9f420bc19a45187010cacc710420cd17a74c6d1d
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/1175129
Reviewed-on: https://git-master.nvidia.com/r/1768536
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
| -rw-r--r-- | drivers/platform/tegra/tegra_prod.c | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/drivers/platform/tegra/tegra_prod.c b/drivers/platform/tegra/tegra_prod.c index 25fca77da..131fff264 100644 --- a/drivers/platform/tegra/tegra_prod.c +++ b/drivers/platform/tegra/tegra_prod.c | |||
| @@ -506,14 +506,7 @@ static struct tegra_prod *tegra_prod_get(struct device *dev, const char *name) | |||
| 506 | return tegra_prod_init(dev->of_node); | 506 | return tegra_prod_init(dev->of_node); |
| 507 | } | 507 | } |
| 508 | 508 | ||
| 509 | /** | 509 | int tegra_prod_put(struct tegra_prod *tegra_prod) |
| 510 | * tegra_prod_release - Release all the resources. | ||
| 511 | * @tegra_prod: the list of tegra prods. | ||
| 512 | * | ||
| 513 | * Release all the resources of tegra_prod. | ||
| 514 | * Returns 0 on success. | ||
| 515 | */ | ||
| 516 | static int tegra_prod_release(struct tegra_prod **tegra_prod) | ||
| 517 | { | 510 | { |
| 518 | int i; | 511 | int i; |
| 519 | struct tegra_prod_config *t_prod; | 512 | struct tegra_prod_config *t_prod; |
| @@ -522,30 +515,27 @@ static int tegra_prod_release(struct tegra_prod **tegra_prod) | |||
| 522 | if (!tegra_prod) | 515 | if (!tegra_prod) |
| 523 | return -EINVAL; | 516 | return -EINVAL; |
| 524 | 517 | ||
| 525 | tp_list = *tegra_prod; | 518 | tp_list = tegra_prod; |
| 526 | if (tp_list) { | 519 | if (tp_list->prod_config) { |
| 527 | if (tp_list->prod_config) { | 520 | for (i = 0; i < tp_list->num; i++) { |
| 528 | for (i = 0; i < tp_list->num; i++) { | 521 | t_prod = &tp_list->prod_config[i]; |
| 529 | t_prod = (struct tegra_prod_config *) | 522 | if (t_prod) |
| 530 | &tp_list->prod_config[i]; | 523 | kfree(t_prod->prod_tuple); |
| 531 | if (t_prod) | ||
| 532 | kfree(t_prod->prod_tuple); | ||
| 533 | } | ||
| 534 | kfree(tp_list->prod_config); | ||
| 535 | } | 524 | } |
| 536 | kfree(tp_list); | 525 | kfree(tp_list->prod_config); |
| 537 | } | 526 | } |
| 527 | kfree(tp_list); | ||
| 538 | 528 | ||
| 539 | *tegra_prod = NULL; | ||
| 540 | return 0; | 529 | return 0; |
| 541 | } | 530 | } |
| 531 | EXPORT_SYMBOL(tegra_prod_put); | ||
| 542 | 532 | ||
| 543 | static void devm_tegra_prod_release(struct device *dev, void *res) | 533 | static void devm_tegra_prod_release(struct device *dev, void *res) |
| 544 | 534 | ||
| 545 | { | 535 | { |
| 546 | struct tegra_prod *prod_list = *(struct tegra_prod **)res; | 536 | struct tegra_prod *prod_list = *(struct tegra_prod **)res; |
| 547 | 537 | ||
| 548 | tegra_prod_release(&prod_list); | 538 | tegra_prod_put(prod_list); |
| 549 | } | 539 | } |
| 550 | 540 | ||
| 551 | struct tegra_prod *devm_tegra_prod_get(struct device *dev) | 541 | struct tegra_prod *devm_tegra_prod_get(struct device *dev) |
| @@ -574,9 +564,3 @@ struct tegra_prod *tegra_prod_get_from_node(struct device_node *np) | |||
| 574 | return tegra_prod_init(np); | 564 | return tegra_prod_init(np); |
| 575 | } | 565 | } |
| 576 | EXPORT_SYMBOL(tegra_prod_get_from_node); | 566 | EXPORT_SYMBOL(tegra_prod_get_from_node); |
| 577 | |||
| 578 | int tegra_prod_put(struct tegra_prod *tegra_prod) | ||
| 579 | { | ||
| 580 | return tegra_prod_release(&tegra_prod); | ||
| 581 | } | ||
| 582 | EXPORT_SYMBOL(tegra_prod_put); | ||
