diff options
| author | 2019-07-08 11:31:39 -0400 | |
|---|---|---|
| committer | 2019-08-15 10:53:55 -0500 | |
| commit | 91db9311945f01901ddb9813ce11364de214a156 (patch) | |
| tree | 1afec6692b3e5f2a29036ab0b889bf558adf91ac /drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.h | |
| parent | drm/amd/display: Add work-around option to skip DCN20 clock updates (diff) | |
| download | linux-dev-91db9311945f01901ddb9813ce11364de214a156.tar.xz linux-dev-91db9311945f01901ddb9813ce11364de214a156.zip | |
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/hw_ddc.h')
| -rw-r--r-- | drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.h b/drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.h index 9690e2a885d7..cc30e65df431 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.h +++ b/drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.h @@ -38,9 +38,12 @@ struct hw_ddc { #define HW_DDC_FROM_BASE(hw_gpio) \ container_of((HW_GPIO_FROM_BASE(hw_gpio)), struct hw_ddc, base) -struct hw_gpio_pin *dal_hw_ddc_create( +void dal_hw_ddc_init( + struct hw_ddc **hw_ddc, struct dc_context *ctx, enum gpio_id id, uint32_t en); +struct hw_gpio_pin *dal_hw_ddc_get_pin(struct gpio *gpio); + #endif |
