dsi.c (5ae4f63b5062bc4e329940cc5cecdf0856b85849) dsi.c (9d32c4989c858af12b333ae9a3c160a91ff43934)
1/*
2 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 15 unchanged lines hidden (view full) ---

24}
25
26static void dsi_destroy(struct msm_dsi *msm_dsi)
27{
28 if (!msm_dsi)
29 return;
30
31 msm_dsi_manager_unregister(msm_dsi);
1/*
2 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 15 unchanged lines hidden (view full) ---

24}
25
26static void dsi_destroy(struct msm_dsi *msm_dsi)
27{
28 if (!msm_dsi)
29 return;
30
31 msm_dsi_manager_unregister(msm_dsi);
32
33 if (msm_dsi->phy) {
34 msm_dsi_phy_destroy(msm_dsi->phy);
35 msm_dsi->phy = NULL;
36 }
37
32 if (msm_dsi->host) {
33 msm_dsi_host_destroy(msm_dsi->host);
34 msm_dsi->host = NULL;
35 }
36
37 platform_set_drvdata(msm_dsi->pdev, NULL);
38}
39

--- 18 unchanged lines hidden (view full) ---

58 msm_dsi->pdev = pdev;
59 platform_set_drvdata(pdev, msm_dsi);
60
61 /* Init dsi host */
62 ret = msm_dsi_host_init(msm_dsi);
63 if (ret)
64 goto fail;
65
38 if (msm_dsi->host) {
39 msm_dsi_host_destroy(msm_dsi->host);
40 msm_dsi->host = NULL;
41 }
42
43 platform_set_drvdata(msm_dsi->pdev, NULL);
44}
45

--- 18 unchanged lines hidden (view full) ---

64 msm_dsi->pdev = pdev;
65 platform_set_drvdata(pdev, msm_dsi);
66
67 /* Init dsi host */
68 ret = msm_dsi_host_init(msm_dsi);
69 if (ret)
70 goto fail;
71
72 /* Init dsi PHY */
73 msm_dsi->phy = msm_dsi_phy_init(pdev, msm_dsi->phy_type, msm_dsi->id);
74 if (!msm_dsi->phy) {
75 ret = -ENXIO;
76 pr_err("%s: phy init failed\n", __func__);
77 goto fail;
78 }
79
66 /* Register to dsi manager */
67 ret = msm_dsi_manager_register(msm_dsi);
68 if (ret)
69 goto fail;
70
71 return msm_dsi;
72
73fail:

--- 139 unchanged lines hidden ---
80 /* Register to dsi manager */
81 ret = msm_dsi_manager_register(msm_dsi);
82 if (ret)
83 goto fail;
84
85 return msm_dsi;
86
87fail:

--- 139 unchanged lines hidden ---