summaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2016-07-01 09:30:04 -0400
committerPreetham Chandru R <pchandru@nvidia.com>2017-08-21 05:16:34 -0400
commitb27e0a92b1f7a5ee82b2edc987f69db5ad43bfde (patch)
tree2b9725315353753285a4d4dcc1d99b99a3392da9 /drivers/ata
parentdc50fa89126798485ece55f54fcb2b8fac8d235a (diff)
ata: tegra: Use devm for tegra_prod allocation
Use devm_tegra_prod_get() to allocate the tegra_prod handle. This is managed API and do not need to explicitly release the handle. Change-Id: I86a76a844e10cdcb85d88747fb338e3afba6769a Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/1174611 (cherry picked from commit 728447d4aea4747228dbf588e303f5b96abe0d13)
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/tegra/ahci_tegra.c16
-rw-r--r--drivers/ata/tegra/ahci_tegra.h2
2 files changed, 2 insertions, 16 deletions
diff --git a/drivers/ata/tegra/ahci_tegra.c b/drivers/ata/tegra/ahci_tegra.c
index e87776502..d687c9779 100644
--- a/drivers/ata/tegra/ahci_tegra.c
+++ b/drivers/ata/tegra/ahci_tegra.c
@@ -729,11 +729,6 @@ static void tegra_ahci_power_off(struct ahci_host_priv *hpriv)
729 729
730 regulator_bulk_disable(tegra->soc_data->num_sata_regulators, 730 regulator_bulk_disable(tegra->soc_data->num_sata_regulators,
731 tegra->supplies); 731 tegra->supplies);
732
733 if (tegra && tegra->prod_list) {
734 tegra_prod_release(&tegra->prod_list);
735 tegra->prod_list = NULL;
736 }
737} 732}
738 733
739static int tegra_ahci_controller_init(struct ahci_host_priv *hpriv) 734static int tegra_ahci_controller_init(struct ahci_host_priv *hpriv)
@@ -1235,7 +1230,7 @@ tegra_ahci_platform_get_resources(struct tegra_ahci_priv *tegra)
1235 goto err_out; 1230 goto err_out;
1236 } 1231 }
1237 1232
1238 tegra->prod_list = tegra_prod_init(dev->of_node); 1233 tegra->prod_list = devm_tegra_prod_get(dev);
1239 if (IS_ERR(tegra->prod_list)) { 1234 if (IS_ERR(tegra->prod_list)) {
1240 dev_err(dev, "Prod Init failed\n"); 1235 dev_err(dev, "Prod Init failed\n");
1241 tegra->prod_list = NULL; 1236 tegra->prod_list = NULL;
@@ -1257,17 +1252,8 @@ err_out:
1257 1252
1258static void tegra_ahci_shutdown(struct platform_device *pdev) 1253static void tegra_ahci_shutdown(struct platform_device *pdev)
1259{ 1254{
1260 struct ata_host *host = platform_get_drvdata(pdev);
1261 struct ahci_host_priv *hpriv = host->private_data;
1262 struct tegra_ahci_priv *tegra = hpriv->plat_data;
1263
1264 if (!pm_runtime_suspended(&pdev->dev)) 1255 if (!pm_runtime_suspended(&pdev->dev))
1265 ata_platform_remove_one(pdev); 1256 ata_platform_remove_one(pdev);
1266
1267 if (tegra && tegra->prod_list) {
1268 tegra_prod_release(&tegra->prod_list);
1269 tegra->prod_list = NULL;
1270 }
1271} 1257}
1272 1258
1273static int tegra_ahci_probe(struct platform_device *pdev) 1259static int tegra_ahci_probe(struct platform_device *pdev)
diff --git a/drivers/ata/tegra/ahci_tegra.h b/drivers/ata/tegra/ahci_tegra.h
index 5bcb0bcf1..da2c79731 100644
--- a/drivers/ata/tegra/ahci_tegra.h
+++ b/drivers/ata/tegra/ahci_tegra.h
@@ -207,7 +207,7 @@ struct tegra_ahci_priv {
207 struct pinctrl *devslp_pin; 207 struct pinctrl *devslp_pin;
208 struct pinctrl_state *devslp_active; 208 struct pinctrl_state *devslp_active;
209 struct pinctrl_state *devslp_pullup; 209 struct pinctrl_state *devslp_pullup;
210 struct tegra_prod_list *prod_list; 210 struct tegra_prod *prod_list;
211 int devslp_gpio; 211 int devslp_gpio;
212 bool devslp_override; 212 bool devslp_override;
213 bool devslp_pinmux_override; 213 bool devslp_pinmux_override;