diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sdvo.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index f5b7e1e7c5e0..e87d2f418de4 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -2426,6 +2426,22 @@ intel_sdvo_add_hdmi_properties(struct intel_sdvo *intel_sdvo, | |||
2426 | } | 2426 | } |
2427 | } | 2427 | } |
2428 | 2428 | ||
2429 | static struct intel_sdvo_connector *intel_sdvo_connector_alloc(void) | ||
2430 | { | ||
2431 | struct intel_sdvo_connector *sdvo_connector; | ||
2432 | |||
2433 | sdvo_connector = kzalloc(sizeof(*sdvo_connector), GFP_KERNEL); | ||
2434 | if (!sdvo_connector) | ||
2435 | return NULL; | ||
2436 | |||
2437 | if (intel_connector_init(&sdvo_connector->base) < 0) { | ||
2438 | kfree(sdvo_connector); | ||
2439 | return NULL; | ||
2440 | } | ||
2441 | |||
2442 | return sdvo_connector; | ||
2443 | } | ||
2444 | |||
2429 | static bool | 2445 | static bool |
2430 | intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) | 2446 | intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) |
2431 | { | 2447 | { |
@@ -2437,7 +2453,7 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) | |||
2437 | 2453 | ||
2438 | DRM_DEBUG_KMS("initialising DVI device %d\n", device); | 2454 | DRM_DEBUG_KMS("initialising DVI device %d\n", device); |
2439 | 2455 | ||
2440 | intel_sdvo_connector = kzalloc(sizeof(*intel_sdvo_connector), GFP_KERNEL); | 2456 | intel_sdvo_connector = intel_sdvo_connector_alloc(); |
2441 | if (!intel_sdvo_connector) | 2457 | if (!intel_sdvo_connector) |
2442 | return false; | 2458 | return false; |
2443 | 2459 | ||
@@ -2491,7 +2507,7 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) | |||
2491 | 2507 | ||
2492 | DRM_DEBUG_KMS("initialising TV type %d\n", type); | 2508 | DRM_DEBUG_KMS("initialising TV type %d\n", type); |
2493 | 2509 | ||
2494 | intel_sdvo_connector = kzalloc(sizeof(*intel_sdvo_connector), GFP_KERNEL); | 2510 | intel_sdvo_connector = intel_sdvo_connector_alloc(); |
2495 | if (!intel_sdvo_connector) | 2511 | if (!intel_sdvo_connector) |
2496 | return false; | 2512 | return false; |
2497 | 2513 | ||
@@ -2570,7 +2586,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) | |||
2570 | 2586 | ||
2571 | DRM_DEBUG_KMS("initialising LVDS device %d\n", device); | 2587 | DRM_DEBUG_KMS("initialising LVDS device %d\n", device); |
2572 | 2588 | ||
2573 | intel_sdvo_connector = kzalloc(sizeof(*intel_sdvo_connector), GFP_KERNEL); | 2589 | intel_sdvo_connector = intel_sdvo_connector_alloc(); |
2574 | if (!intel_sdvo_connector) | 2590 | if (!intel_sdvo_connector) |
2575 | return false; | 2591 | return false; |
2576 | 2592 | ||