summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/gpio/dcn20/hw_factory_dcn20.c
diff options
context:
space:
mode:
authorSu Sung Chung <Su.Chung@amd.com>2019-07-08 11:31:39 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-08-15 10:53:55 -0500
commit91db9311945f01901ddb9813ce11364de214a156 (patch)
tree1afec6692b3e5f2a29036ab0b889bf558adf91ac /drivers/gpu/drm/amd/display/dc/gpio/dcn20/hw_factory_dcn20.c
parent37495fbdf12d1bce30dbc228c901ef45eba35739 (diff)
drm/amd/display: refactor gpio to allocate hw_container in constructor
[why] if dynamic allocation fails during gpio_open, it will cause crash due to page fault. [how] handle allocation when gpio object gets created and prevent from calling gpio_open if allocation failed Signed-off-by: Su Sung Chung <Su.Chung@amd.com> Reviewed-by: Jun Lei <Jun.Lei@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/gpio/dcn20/hw_factory_dcn20.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/gpio/dcn20/hw_factory_dcn20.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/gpio/dcn20/hw_factory_dcn20.c b/drivers/gpu/drm/amd/display/dc/gpio/dcn20/hw_factory_dcn20.c
index afb7c0f111bf..43a440385b43 100644
--- a/drivers/gpu/drm/amd/display/dc/gpio/dcn20/hw_factory_dcn20.c
+++ b/drivers/gpu/drm/amd/display/dc/gpio/dcn20/hw_factory_dcn20.c
@@ -212,12 +212,12 @@ static void define_generic_registers(struct hw_gpio_pin *pin, uint32_t en)
/* fucntion table */
static const struct hw_factory_funcs funcs = {
- .create_ddc_data = dal_hw_ddc_create,
- .create_ddc_clock = dal_hw_ddc_create,
- .create_generic = dal_hw_generic_create,
- .create_hpd = dal_hw_hpd_create,
- .create_sync = NULL,
- .create_gsl = NULL,
+ .init_ddc_data = dal_hw_ddc_init,
+ .init_generic = dal_hw_generic_init,
+ .init_hpd = dal_hw_hpd_init,
+ .get_ddc_pin = dal_hw_ddc_get_pin,
+ .get_hpd_pin = dal_hw_hpd_get_pin,
+ .get_generic_pin = dal_hw_generic_get_pin,
.define_hpd_registers = define_hpd_registers,
.define_ddc_registers = define_ddc_registers,
.define_generic_registers = define_generic_registers,