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>
Šī revīzija ir iekļauta:
Su Sung Chung
2019-07-08 11:31:39 -04:00
revīziju iesūtīja Alex Deucher
vecāks 37495fbdf1
revīzija 91db931194
18 mainīti faili ar 247 papildinājumiem un 139 dzēšanām

Parādīt failu

@@ -93,8 +93,17 @@ enum sync_source dal_gpio_get_sync_source(
enum gpio_pin_output_state dal_gpio_get_output_state(
const struct gpio *gpio);
struct hw_ddc *dal_gpio_get_ddc(struct gpio *gpio);
struct hw_hpd *dal_gpio_get_hpd(struct gpio *gpio);
struct hw_generic *dal_gpio_get_generic(struct gpio *gpio);
/* Close the handle */
void dal_gpio_close(
struct gpio *gpio);
#endif