drm/amd/display: refactor gpio to allocate hw_container in constructor
authorSu Sung Chung <Su.Chung@amd.com>
Mon, 8 Jul 2019 15:31:39 +0000 (11:31 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Aug 2019 15:53:55 +0000 (10:53 -0500)
commit91db9311945f01901ddb9813ce11364de214a156
tree1afec6692b3e5f2a29036ab0b889bf558adf91ac
parent37495fbdf12d1bce30dbc228c901ef45eba35739
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>
18 files changed:
drivers/gpu/drm/amd/display/dc/gpio/dce110/hw_factory_dce110.c
drivers/gpu/drm/amd/display/dc/gpio/dce120/hw_factory_dce120.c
drivers/gpu/drm/amd/display/dc/gpio/dce80/hw_factory_dce80.c
drivers/gpu/drm/amd/display/dc/gpio/dcn10/hw_factory_dcn10.c
drivers/gpu/drm/amd/display/dc/gpio/dcn20/hw_factory_dcn20.c
drivers/gpu/drm/amd/display/dc/gpio/diagnostics/hw_factory_diag.c
drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c
drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c
drivers/gpu/drm/amd/display/dc/gpio/gpio_service.h
drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c
drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.h
drivers/gpu/drm/amd/display/dc/gpio/hw_factory.h
drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c
drivers/gpu/drm/amd/display/dc/gpio/hw_generic.h
drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c
drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.h
drivers/gpu/drm/amd/display/dc/inc/hw/gpio.h
drivers/gpu/drm/amd/display/include/gpio_interface.h