diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-03-11 05:46:03 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-03-11 05:46:03 -0500 |
commit | a45216547e8925078b18b2a6b539100c3814e973 (patch) | |
tree | fd07faaf4ad557152d71b336f9304c93075f41ed | |
parent | 35dc8aabc8783d6322a59d774af2858e5955d2ab (diff) | |
parent | 76adb460fd939756db689f238d5c2ddb45469705 (diff) |
Merge branch 'drm/next/platform' of git://linuxtv.org/pinchartl/media into drm-misc-next
Merge Laurent's drm_platform removal code. Only conflict is with the
drm_pci.h extraction, which allows me to fix up the misplayed
drm_platform_init fumble that 0day and Stephen Rothwell reported.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
22 files changed, 236 insertions, 336 deletions
diff --git a/Documentation/gpu/drm-internals.rst b/Documentation/gpu/drm-internals.rst index b00bf8229080..3bb4d937cdfe 100644 --- a/Documentation/gpu/drm-internals.rst +++ b/Documentation/gpu/drm-internals.rst | |||
@@ -240,9 +240,6 @@ drivers. | |||
240 | .. kernel-doc:: drivers/gpu/drm/drm_pci.c | 240 | .. kernel-doc:: drivers/gpu/drm/drm_pci.c |
241 | :export: | 241 | :export: |
242 | 242 | ||
243 | .. kernel-doc:: drivers/gpu/drm/drm_platform.c | ||
244 | :export: | ||
245 | |||
246 | Open/Close, File Operations and IOCTLs | 243 | Open/Close, File Operations and IOCTLs |
247 | ====================================== | 244 | ====================================== |
248 | 245 | ||
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index eb54ffabacc5..59aae43005ee 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile | |||
@@ -7,7 +7,7 @@ drm-y := drm_auth.o drm_bufs.o drm_cache.o \ | |||
7 | drm_file.o drm_gem.o drm_ioctl.o drm_irq.o \ | 7 | drm_file.o drm_gem.o drm_ioctl.o drm_irq.o \ |
8 | drm_lock.o drm_memory.o drm_drv.o \ | 8 | drm_lock.o drm_memory.o drm_drv.o \ |
9 | drm_scatter.o drm_pci.o \ | 9 | drm_scatter.o drm_pci.o \ |
10 | drm_platform.o drm_sysfs.o drm_hashtab.o drm_mm.o \ | 10 | drm_sysfs.o drm_hashtab.o drm_mm.o \ |
11 | drm_crtc.o drm_fourcc.o drm_modes.o drm_edid.o \ | 11 | drm_crtc.o drm_fourcc.o drm_modes.o drm_edid.o \ |
12 | drm_info.o drm_encoder_slave.o \ | 12 | drm_info.o drm_encoder_slave.o \ |
13 | drm_trace_points.o drm_global.o drm_prime.o \ | 13 | drm_trace_points.o drm_global.o drm_prime.o \ |
diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c index 1952e8748fea..408e00b64cf6 100644 --- a/drivers/gpu/drm/armada/armada_drv.c +++ b/drivers/gpu/drm/armada/armada_drv.c | |||
@@ -137,10 +137,9 @@ static int armada_drm_bind(struct device *dev) | |||
137 | return ret; | 137 | return ret; |
138 | } | 138 | } |
139 | 139 | ||
140 | priv->drm.platformdev = to_platform_device(dev); | ||
141 | priv->drm.dev_private = priv; | 140 | priv->drm.dev_private = priv; |
142 | 141 | ||
143 | platform_set_drvdata(priv->drm.platformdev, &priv->drm); | 142 | dev_set_drvdata(dev, &priv->drm); |
144 | 143 | ||
145 | INIT_WORK(&priv->fb_unref_work, armada_drm_unref_work); | 144 | INIT_WORK(&priv->fb_unref_work, armada_drm_unref_work); |
146 | INIT_KFIFO(priv->fb_unref); | 145 | INIT_KFIFO(priv->fb_unref); |
diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c deleted file mode 100644 index 56d2f93ed6b9..000000000000 --- a/drivers/gpu/drm/drm_platform.c +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | /* | ||
2 | * Derived from drm_pci.c | ||
3 | * | ||
4 | * Copyright 2003 José Fonseca. | ||
5 | * Copyright 2003 Leif Delgass. | ||
6 | * Copyright (c) 2009, Code Aurora Forum. | ||
7 | * All Rights Reserved. | ||
8 | * | ||
9 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
10 | * copy of this software and associated documentation files (the "Software"), | ||
11 | * to deal in the Software without restriction, including without limitation | ||
12 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
13 | * and/or sell copies of the Software, and to permit persons to whom the | ||
14 | * Software is furnished to do so, subject to the following conditions: | ||
15 | * | ||
16 | * The above copyright notice and this permission notice (including the next | ||
17 | * paragraph) shall be included in all copies or substantial portions of the | ||
18 | * Software. | ||
19 | * | ||
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
23 | * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
25 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
26 | */ | ||
27 | |||
28 | #include <linux/export.h> | ||
29 | #include <drm/drmP.h> | ||
30 | |||
31 | /* | ||
32 | * Register. | ||
33 | * | ||
34 | * \param platdev - Platform device struture | ||
35 | * \return zero on success or a negative number on failure. | ||
36 | * | ||
37 | * Attempt to gets inter module "drm" information. If we are first | ||
38 | * then register the character device and inter module information. | ||
39 | * Try and register, if we fail to register, backout previous work. | ||
40 | */ | ||
41 | |||
42 | static int drm_get_platform_dev(struct platform_device *platdev, | ||
43 | struct drm_driver *driver) | ||
44 | { | ||
45 | struct drm_device *dev; | ||
46 | int ret; | ||
47 | |||
48 | DRM_DEBUG("\n"); | ||
49 | |||
50 | dev = drm_dev_alloc(driver, &platdev->dev); | ||
51 | if (IS_ERR(dev)) | ||
52 | return PTR_ERR(dev); | ||
53 | |||
54 | dev->platformdev = platdev; | ||
55 | |||
56 | ret = drm_dev_register(dev, 0); | ||
57 | if (ret) | ||
58 | goto err_free; | ||
59 | |||
60 | return 0; | ||
61 | |||
62 | err_free: | ||
63 | drm_dev_unref(dev); | ||
64 | return ret; | ||
65 | } | ||
66 | |||
67 | /** | ||
68 | * drm_platform_init - Register a platform device with the DRM subsystem | ||
69 | * @driver: DRM device driver | ||
70 | * @platform_device: platform device to register | ||
71 | * | ||
72 | * Registers the specified DRM device driver and platform device with the DRM | ||
73 | * subsystem, initializing a drm_device structure and calling the driver's | ||
74 | * .load() function. | ||
75 | * | ||
76 | * NOTE: This function is deprecated, please use drm_dev_alloc() and | ||
77 | * drm_dev_register() instead and remove your &drm_driver.load callback. | ||
78 | * | ||
79 | * Return: 0 on success or a negative error code on failure. | ||
80 | */ | ||
81 | int drm_platform_init(struct drm_driver *driver, struct platform_device *platform_device) | ||
82 | { | ||
83 | DRM_DEBUG("\n"); | ||
84 | |||
85 | return drm_get_platform_dev(platform_device, driver); | ||
86 | } | ||
87 | EXPORT_SYMBOL(drm_platform_init); | ||
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c index 1ef0be338b85..b445b50a5dc4 100644 --- a/drivers/gpu/drm/exynos/exynos_dp.c +++ b/drivers/gpu/drm/exynos/exynos_dp.c | |||
@@ -101,7 +101,6 @@ static int exynos_dp_bridge_attach(struct analogix_dp_plat_data *plat_data, | |||
101 | struct exynos_dp_device *dp = to_dp(plat_data); | 101 | struct exynos_dp_device *dp = to_dp(plat_data); |
102 | int ret; | 102 | int ret; |
103 | 103 | ||
104 | drm_connector_register(connector); | ||
105 | dp->connector = connector; | 104 | dp->connector = connector; |
106 | 105 | ||
107 | /* Pre-empt DP connector creation if there's a bridge */ | 106 | /* Pre-empt DP connector creation if there's a bridge */ |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c b/drivers/gpu/drm/exynos/exynos_drm_dpi.c index ad6b73c7fc59..3aab71a485ba 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c | |||
@@ -114,7 +114,6 @@ static int exynos_dpi_create_connector(struct drm_encoder *encoder) | |||
114 | } | 114 | } |
115 | 115 | ||
116 | drm_connector_helper_add(connector, &exynos_dpi_connector_helper_funcs); | 116 | drm_connector_helper_add(connector, &exynos_dpi_connector_helper_funcs); |
117 | drm_connector_register(connector); | ||
118 | drm_mode_connector_attach_encoder(connector, encoder); | 117 | drm_mode_connector_attach_encoder(connector, encoder); |
119 | 118 | ||
120 | return 0; | 119 | return 0; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index b4522f67b3cb..09d3c4c3c858 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c | |||
@@ -39,118 +39,6 @@ | |||
39 | 39 | ||
40 | static struct device *exynos_drm_get_dma_device(void); | 40 | static struct device *exynos_drm_get_dma_device(void); |
41 | 41 | ||
42 | static int exynos_drm_load(struct drm_device *dev, unsigned long flags) | ||
43 | { | ||
44 | struct exynos_drm_private *private; | ||
45 | struct drm_encoder *encoder; | ||
46 | unsigned int clone_mask; | ||
47 | int cnt, ret; | ||
48 | |||
49 | private = kzalloc(sizeof(struct exynos_drm_private), GFP_KERNEL); | ||
50 | if (!private) | ||
51 | return -ENOMEM; | ||
52 | |||
53 | init_waitqueue_head(&private->wait); | ||
54 | spin_lock_init(&private->lock); | ||
55 | |||
56 | dev_set_drvdata(dev->dev, dev); | ||
57 | dev->dev_private = (void *)private; | ||
58 | |||
59 | /* the first real CRTC device is used for all dma mapping operations */ | ||
60 | private->dma_dev = exynos_drm_get_dma_device(); | ||
61 | if (!private->dma_dev) { | ||
62 | DRM_ERROR("no device found for DMA mapping operations.\n"); | ||
63 | ret = -ENODEV; | ||
64 | goto err_free_private; | ||
65 | } | ||
66 | DRM_INFO("Exynos DRM: using %s device for DMA mapping operations\n", | ||
67 | dev_name(private->dma_dev)); | ||
68 | |||
69 | /* create common IOMMU mapping for all devices attached to Exynos DRM */ | ||
70 | ret = drm_create_iommu_mapping(dev); | ||
71 | if (ret < 0) { | ||
72 | DRM_ERROR("failed to create iommu mapping.\n"); | ||
73 | goto err_free_private; | ||
74 | } | ||
75 | |||
76 | drm_mode_config_init(dev); | ||
77 | |||
78 | exynos_drm_mode_config_init(dev); | ||
79 | |||
80 | /* setup possible_clones. */ | ||
81 | cnt = 0; | ||
82 | clone_mask = 0; | ||
83 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) | ||
84 | clone_mask |= (1 << (cnt++)); | ||
85 | |||
86 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) | ||
87 | encoder->possible_clones = clone_mask; | ||
88 | |||
89 | platform_set_drvdata(dev->platformdev, dev); | ||
90 | |||
91 | /* Try to bind all sub drivers. */ | ||
92 | ret = component_bind_all(dev->dev, dev); | ||
93 | if (ret) | ||
94 | goto err_mode_config_cleanup; | ||
95 | |||
96 | ret = drm_vblank_init(dev, dev->mode_config.num_crtc); | ||
97 | if (ret) | ||
98 | goto err_unbind_all; | ||
99 | |||
100 | /* Probe non kms sub drivers and virtual display driver. */ | ||
101 | ret = exynos_drm_device_subdrv_probe(dev); | ||
102 | if (ret) | ||
103 | goto err_cleanup_vblank; | ||
104 | |||
105 | drm_mode_config_reset(dev); | ||
106 | |||
107 | /* | ||
108 | * enable drm irq mode. | ||
109 | * - with irq_enabled = true, we can use the vblank feature. | ||
110 | * | ||
111 | * P.S. note that we wouldn't use drm irq handler but | ||
112 | * just specific driver own one instead because | ||
113 | * drm framework supports only one irq handler. | ||
114 | */ | ||
115 | dev->irq_enabled = true; | ||
116 | |||
117 | /* init kms poll for handling hpd */ | ||
118 | drm_kms_helper_poll_init(dev); | ||
119 | |||
120 | /* force connectors detection */ | ||
121 | drm_helper_hpd_irq_event(dev); | ||
122 | |||
123 | return 0; | ||
124 | |||
125 | err_cleanup_vblank: | ||
126 | drm_vblank_cleanup(dev); | ||
127 | err_unbind_all: | ||
128 | component_unbind_all(dev->dev, dev); | ||
129 | err_mode_config_cleanup: | ||
130 | drm_mode_config_cleanup(dev); | ||
131 | drm_release_iommu_mapping(dev); | ||
132 | err_free_private: | ||
133 | kfree(private); | ||
134 | |||
135 | return ret; | ||
136 | } | ||
137 | |||
138 | static void exynos_drm_unload(struct drm_device *dev) | ||
139 | { | ||
140 | exynos_drm_device_subdrv_remove(dev); | ||
141 | |||
142 | exynos_drm_fbdev_fini(dev); | ||
143 | drm_kms_helper_poll_fini(dev); | ||
144 | |||
145 | drm_vblank_cleanup(dev); | ||
146 | component_unbind_all(dev->dev, dev); | ||
147 | drm_mode_config_cleanup(dev); | ||
148 | drm_release_iommu_mapping(dev); | ||
149 | |||
150 | kfree(dev->dev_private); | ||
151 | dev->dev_private = NULL; | ||
152 | } | ||
153 | |||
154 | int exynos_atomic_check(struct drm_device *dev, | 42 | int exynos_atomic_check(struct drm_device *dev, |
155 | struct drm_atomic_state *state) | 43 | struct drm_atomic_state *state) |
156 | { | 44 | { |
@@ -256,8 +144,6 @@ static const struct file_operations exynos_drm_driver_fops = { | |||
256 | static struct drm_driver exynos_drm_driver = { | 144 | static struct drm_driver exynos_drm_driver = { |
257 | .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | 145 | .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
258 | | DRIVER_ATOMIC | DRIVER_RENDER, | 146 | | DRIVER_ATOMIC | DRIVER_RENDER, |
259 | .load = exynos_drm_load, | ||
260 | .unload = exynos_drm_unload, | ||
261 | .open = exynos_drm_open, | 147 | .open = exynos_drm_open, |
262 | .preclose = exynos_drm_preclose, | 148 | .preclose = exynos_drm_preclose, |
263 | .lastclose = exynos_drm_lastclose, | 149 | .lastclose = exynos_drm_lastclose, |
@@ -432,12 +318,135 @@ static struct component_match *exynos_drm_match_add(struct device *dev) | |||
432 | 318 | ||
433 | static int exynos_drm_bind(struct device *dev) | 319 | static int exynos_drm_bind(struct device *dev) |
434 | { | 320 | { |
435 | return drm_platform_init(&exynos_drm_driver, to_platform_device(dev)); | 321 | struct exynos_drm_private *private; |
322 | struct drm_encoder *encoder; | ||
323 | struct drm_device *drm; | ||
324 | unsigned int clone_mask; | ||
325 | int cnt, ret; | ||
326 | |||
327 | drm = drm_dev_alloc(&exynos_drm_driver, dev); | ||
328 | if (IS_ERR(drm)) | ||
329 | return PTR_ERR(drm); | ||
330 | |||
331 | private = kzalloc(sizeof(struct exynos_drm_private), GFP_KERNEL); | ||
332 | if (!private) { | ||
333 | ret = -ENOMEM; | ||
334 | goto err_free_drm; | ||
335 | } | ||
336 | |||
337 | init_waitqueue_head(&private->wait); | ||
338 | spin_lock_init(&private->lock); | ||
339 | |||
340 | dev_set_drvdata(dev, drm); | ||
341 | drm->dev_private = (void *)private; | ||
342 | |||
343 | /* the first real CRTC device is used for all dma mapping operations */ | ||
344 | private->dma_dev = exynos_drm_get_dma_device(); | ||
345 | if (!private->dma_dev) { | ||
346 | DRM_ERROR("no device found for DMA mapping operations.\n"); | ||
347 | ret = -ENODEV; | ||
348 | goto err_free_private; | ||
349 | } | ||
350 | DRM_INFO("Exynos DRM: using %s device for DMA mapping operations\n", | ||
351 | dev_name(private->dma_dev)); | ||
352 | |||
353 | /* create common IOMMU mapping for all devices attached to Exynos DRM */ | ||
354 | ret = drm_create_iommu_mapping(drm); | ||
355 | if (ret < 0) { | ||
356 | DRM_ERROR("failed to create iommu mapping.\n"); | ||
357 | goto err_free_private; | ||
358 | } | ||
359 | |||
360 | drm_mode_config_init(drm); | ||
361 | |||
362 | exynos_drm_mode_config_init(drm); | ||
363 | |||
364 | /* setup possible_clones. */ | ||
365 | cnt = 0; | ||
366 | clone_mask = 0; | ||
367 | list_for_each_entry(encoder, &drm->mode_config.encoder_list, head) | ||
368 | clone_mask |= (1 << (cnt++)); | ||
369 | |||
370 | list_for_each_entry(encoder, &drm->mode_config.encoder_list, head) | ||
371 | encoder->possible_clones = clone_mask; | ||
372 | |||
373 | /* Try to bind all sub drivers. */ | ||
374 | ret = component_bind_all(drm->dev, drm); | ||
375 | if (ret) | ||
376 | goto err_mode_config_cleanup; | ||
377 | |||
378 | ret = drm_vblank_init(drm, drm->mode_config.num_crtc); | ||
379 | if (ret) | ||
380 | goto err_unbind_all; | ||
381 | |||
382 | /* Probe non kms sub drivers and virtual display driver. */ | ||
383 | ret = exynos_drm_device_subdrv_probe(drm); | ||
384 | if (ret) | ||
385 | goto err_cleanup_vblank; | ||
386 | |||
387 | drm_mode_config_reset(drm); | ||
388 | |||
389 | /* | ||
390 | * enable drm irq mode. | ||
391 | * - with irq_enabled = true, we can use the vblank feature. | ||
392 | * | ||
393 | * P.S. note that we wouldn't use drm irq handler but | ||
394 | * just specific driver own one instead because | ||
395 | * drm framework supports only one irq handler. | ||
396 | */ | ||
397 | drm->irq_enabled = true; | ||
398 | |||
399 | /* init kms poll for handling hpd */ | ||
400 | drm_kms_helper_poll_init(drm); | ||
401 | |||
402 | /* force connectors detection */ | ||
403 | drm_helper_hpd_irq_event(drm); | ||
404 | |||
405 | /* register the DRM device */ | ||
406 | ret = drm_dev_register(drm, 0); | ||
407 | if (ret < 0) | ||
408 | goto err_cleanup_fbdev; | ||
409 | |||
410 | return 0; | ||
411 | |||
412 | err_cleanup_fbdev: | ||
413 | exynos_drm_fbdev_fini(drm); | ||
414 | drm_kms_helper_poll_fini(drm); | ||
415 | exynos_drm_device_subdrv_remove(drm); | ||
416 | err_cleanup_vblank: | ||
417 | drm_vblank_cleanup(drm); | ||
418 | err_unbind_all: | ||
419 | component_unbind_all(drm->dev, drm); | ||
420 | err_mode_config_cleanup: | ||
421 | drm_mode_config_cleanup(drm); | ||
422 | drm_release_iommu_mapping(drm); | ||
423 | err_free_private: | ||
424 | kfree(private); | ||
425 | err_free_drm: | ||
426 | drm_dev_unref(drm); | ||
427 | |||
428 | return ret; | ||
436 | } | 429 | } |
437 | 430 | ||
438 | static void exynos_drm_unbind(struct device *dev) | 431 | static void exynos_drm_unbind(struct device *dev) |
439 | { | 432 | { |
440 | drm_put_dev(dev_get_drvdata(dev)); | 433 | struct drm_device *drm = dev_get_drvdata(dev); |
434 | |||
435 | drm_dev_unregister(drm); | ||
436 | |||
437 | exynos_drm_device_subdrv_remove(drm); | ||
438 | |||
439 | exynos_drm_fbdev_fini(drm); | ||
440 | drm_kms_helper_poll_fini(drm); | ||
441 | |||
442 | component_unbind_all(drm->dev, drm); | ||
443 | drm_mode_config_cleanup(drm); | ||
444 | drm_release_iommu_mapping(drm); | ||
445 | |||
446 | kfree(drm->dev_private); | ||
447 | drm->dev_private = NULL; | ||
448 | |||
449 | drm_dev_unref(drm); | ||
441 | } | 450 | } |
442 | 451 | ||
443 | static const struct component_master_ops exynos_drm_ops = { | 452 | static const struct component_master_ops exynos_drm_ops = { |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 812e2ec0761d..43a45abc524f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c | |||
@@ -1587,7 +1587,6 @@ static int exynos_dsi_create_connector(struct drm_encoder *encoder) | |||
1587 | } | 1587 | } |
1588 | 1588 | ||
1589 | drm_connector_helper_add(connector, &exynos_dsi_connector_helper_funcs); | 1589 | drm_connector_helper_add(connector, &exynos_dsi_connector_helper_funcs); |
1590 | drm_connector_register(connector); | ||
1591 | drm_mode_connector_attach_encoder(connector, encoder); | 1590 | drm_mode_connector_attach_encoder(connector, encoder); |
1592 | 1591 | ||
1593 | return 0; | 1592 | return 0; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 40aa5056d4ae..641531243e04 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c | |||
@@ -119,7 +119,6 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, | |||
119 | struct exynos_drm_gem *exynos_gem; | 119 | struct exynos_drm_gem *exynos_gem; |
120 | struct drm_device *dev = helper->dev; | 120 | struct drm_device *dev = helper->dev; |
121 | struct drm_mode_fb_cmd2 mode_cmd = { 0 }; | 121 | struct drm_mode_fb_cmd2 mode_cmd = { 0 }; |
122 | struct platform_device *pdev = dev->platformdev; | ||
123 | unsigned long size; | 122 | unsigned long size; |
124 | int ret; | 123 | int ret; |
125 | 124 | ||
@@ -142,7 +141,7 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, | |||
142 | * memory area. | 141 | * memory area. |
143 | */ | 142 | */ |
144 | if (IS_ERR(exynos_gem) && is_drm_iommu_supported(dev)) { | 143 | if (IS_ERR(exynos_gem) && is_drm_iommu_supported(dev)) { |
145 | dev_warn(&pdev->dev, "contiguous FB allocation failed, falling back to non-contiguous\n"); | 144 | dev_warn(dev->dev, "contiguous FB allocation failed, falling back to non-contiguous\n"); |
146 | exynos_gem = exynos_drm_gem_create(dev, EXYNOS_BO_NONCONTIG, | 145 | exynos_gem = exynos_drm_gem_create(dev, EXYNOS_BO_NONCONTIG, |
147 | size); | 146 | size); |
148 | } | 147 | } |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index 57fe514d5c5b..6bbb0ea8a6af 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c | |||
@@ -359,7 +359,6 @@ static int vidi_create_connector(struct drm_encoder *encoder) | |||
359 | } | 359 | } |
360 | 360 | ||
361 | drm_connector_helper_add(connector, &vidi_connector_helper_funcs); | 361 | drm_connector_helper_add(connector, &vidi_connector_helper_funcs); |
362 | drm_connector_register(connector); | ||
363 | drm_mode_connector_attach_encoder(connector, encoder); | 362 | drm_mode_connector_attach_encoder(connector, encoder); |
364 | 363 | ||
365 | return 0; | 364 | return 0; |
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 0814ed76445c..52438404c8c9 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c | |||
@@ -920,7 +920,6 @@ static int hdmi_create_connector(struct drm_encoder *encoder) | |||
920 | } | 920 | } |
921 | 921 | ||
922 | drm_connector_helper_add(connector, &hdmi_connector_helper_funcs); | 922 | drm_connector_helper_add(connector, &hdmi_connector_helper_funcs); |
923 | drm_connector_register(connector); | ||
924 | drm_mode_connector_attach_encoder(connector, encoder); | 923 | drm_mode_connector_attach_encoder(connector, encoder); |
925 | 924 | ||
926 | if (hdata->bridge) { | 925 | if (hdata->bridge) { |
diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c index 94ea963519b2..a4e1206a66a8 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | |||
@@ -434,7 +434,7 @@ fail: | |||
434 | 434 | ||
435 | struct msm_kms *mdp4_kms_init(struct drm_device *dev) | 435 | struct msm_kms *mdp4_kms_init(struct drm_device *dev) |
436 | { | 436 | { |
437 | struct platform_device *pdev = dev->platformdev; | 437 | struct platform_device *pdev = to_platform_device(dev->dev); |
438 | struct mdp4_platform_config *config = mdp4_get_config(pdev); | 438 | struct mdp4_platform_config *config = mdp4_get_config(pdev); |
439 | struct mdp4_kms *mdp4_kms; | 439 | struct mdp4_kms *mdp4_kms; |
440 | struct msm_kms *kms = NULL; | 440 | struct msm_kms *kms = NULL; |
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c index 34ab553f6897..ba2d017f6591 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c | |||
@@ -505,7 +505,7 @@ struct mdp5_cfg_handler *mdp5_cfg_init(struct mdp5_kms *mdp5_kms, | |||
505 | uint32_t major, uint32_t minor) | 505 | uint32_t major, uint32_t minor) |
506 | { | 506 | { |
507 | struct drm_device *dev = mdp5_kms->dev; | 507 | struct drm_device *dev = mdp5_kms->dev; |
508 | struct platform_device *pdev = dev->platformdev; | 508 | struct platform_device *pdev = to_platform_device(dev->dev); |
509 | struct mdp5_cfg_handler *cfg_handler; | 509 | struct mdp5_cfg_handler *cfg_handler; |
510 | struct mdp5_cfg_platform *pconfig; | 510 | struct mdp5_cfg_platform *pconfig; |
511 | int i, ret = 0; | 511 | int i, ret = 0; |
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c index d444a6901fff..f8f48d014978 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c | |||
@@ -160,7 +160,7 @@ void msm_mdss_destroy(struct drm_device *dev) | |||
160 | 160 | ||
161 | int msm_mdss_init(struct drm_device *dev) | 161 | int msm_mdss_init(struct drm_device *dev) |
162 | { | 162 | { |
163 | struct platform_device *pdev = dev->platformdev; | 163 | struct platform_device *pdev = to_platform_device(dev->dev); |
164 | struct msm_drm_private *priv = dev->dev_private; | 164 | struct msm_drm_private *priv = dev->dev_private; |
165 | struct msm_mdss *mdss; | 165 | struct msm_mdss *mdss; |
166 | int ret; | 166 | int ret; |
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 604331f3cf39..9208e67be453 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c | |||
@@ -386,7 +386,6 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) | |||
386 | } | 386 | } |
387 | 387 | ||
388 | platform_set_drvdata(pdev, ddev); | 388 | platform_set_drvdata(pdev, ddev); |
389 | ddev->platformdev = pdev; | ||
390 | 389 | ||
391 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 390 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
392 | if (!priv) { | 391 | if (!priv) { |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index f0bb7606eb8b..2b6ac24ce690 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
@@ -108,7 +108,7 @@ nouveau_name(struct drm_device *dev) | |||
108 | if (dev->pdev) | 108 | if (dev->pdev) |
109 | return nouveau_pci_name(dev->pdev); | 109 | return nouveau_pci_name(dev->pdev); |
110 | else | 110 | else |
111 | return nouveau_platform_name(dev->platformdev); | 111 | return nouveau_platform_name(to_platform_device(dev->dev)); |
112 | } | 112 | } |
113 | 113 | ||
114 | static void | 114 | static void |
@@ -1095,7 +1095,6 @@ nouveau_platform_device_create(const struct nvkm_device_tegra_func *func, | |||
1095 | goto err_free; | 1095 | goto err_free; |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | drm->platformdev = pdev; | ||
1099 | platform_set_drvdata(pdev, drm); | 1098 | platform_set_drvdata(pdev, drm); |
1100 | 1099 | ||
1101 | return drm; | 1100 | return drm; |
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c index 8244890e6d53..5fcabc04f307 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c | |||
@@ -711,13 +711,10 @@ int shmob_drm_connector_create(struct shmob_drm_device *sdev, | |||
711 | return ret; | 711 | return ret; |
712 | 712 | ||
713 | drm_connector_helper_add(connector, &connector_helper_funcs); | 713 | drm_connector_helper_add(connector, &connector_helper_funcs); |
714 | ret = drm_connector_register(connector); | ||
715 | if (ret < 0) | ||
716 | goto err_cleanup; | ||
717 | 714 | ||
718 | ret = shmob_drm_backlight_init(&sdev->connector); | 715 | ret = shmob_drm_backlight_init(&sdev->connector); |
719 | if (ret < 0) | 716 | if (ret < 0) |
720 | goto err_sysfs; | 717 | goto err_cleanup; |
721 | 718 | ||
722 | ret = drm_mode_connector_attach_encoder(connector, encoder); | 719 | ret = drm_mode_connector_attach_encoder(connector, encoder); |
723 | if (ret < 0) | 720 | if (ret < 0) |
@@ -731,8 +728,6 @@ int shmob_drm_connector_create(struct shmob_drm_device *sdev, | |||
731 | 728 | ||
732 | err_backlight: | 729 | err_backlight: |
733 | shmob_drm_backlight_exit(&sdev->connector); | 730 | shmob_drm_backlight_exit(&sdev->connector); |
734 | err_sysfs: | ||
735 | drm_connector_unregister(connector); | ||
736 | err_cleanup: | 731 | err_cleanup: |
737 | drm_connector_cleanup(connector); | 732 | drm_connector_cleanup(connector); |
738 | return ret; | 733 | return ret; |
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c index 34fefa0ba0f0..1c7b318b8998 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c | |||
@@ -103,100 +103,6 @@ static int shmob_drm_setup_clocks(struct shmob_drm_device *sdev, | |||
103 | * DRM operations | 103 | * DRM operations |
104 | */ | 104 | */ |
105 | 105 | ||
106 | static void shmob_drm_unload(struct drm_device *dev) | ||
107 | { | ||
108 | drm_kms_helper_poll_fini(dev); | ||
109 | drm_mode_config_cleanup(dev); | ||
110 | drm_vblank_cleanup(dev); | ||
111 | drm_irq_uninstall(dev); | ||
112 | |||
113 | dev->dev_private = NULL; | ||
114 | } | ||
115 | |||
116 | static int shmob_drm_load(struct drm_device *dev, unsigned long flags) | ||
117 | { | ||
118 | struct shmob_drm_platform_data *pdata = dev->dev->platform_data; | ||
119 | struct platform_device *pdev = dev->platformdev; | ||
120 | struct shmob_drm_device *sdev; | ||
121 | struct resource *res; | ||
122 | unsigned int i; | ||
123 | int ret; | ||
124 | |||
125 | if (pdata == NULL) { | ||
126 | dev_err(dev->dev, "no platform data\n"); | ||
127 | return -EINVAL; | ||
128 | } | ||
129 | |||
130 | sdev = devm_kzalloc(&pdev->dev, sizeof(*sdev), GFP_KERNEL); | ||
131 | if (sdev == NULL) { | ||
132 | dev_err(dev->dev, "failed to allocate private data\n"); | ||
133 | return -ENOMEM; | ||
134 | } | ||
135 | |||
136 | sdev->dev = &pdev->dev; | ||
137 | sdev->pdata = pdata; | ||
138 | spin_lock_init(&sdev->irq_lock); | ||
139 | |||
140 | sdev->ddev = dev; | ||
141 | dev->dev_private = sdev; | ||
142 | |||
143 | /* I/O resources and clocks */ | ||
144 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
145 | if (res == NULL) { | ||
146 | dev_err(&pdev->dev, "failed to get memory resource\n"); | ||
147 | return -EINVAL; | ||
148 | } | ||
149 | |||
150 | sdev->mmio = devm_ioremap_nocache(&pdev->dev, res->start, | ||
151 | resource_size(res)); | ||
152 | if (sdev->mmio == NULL) { | ||
153 | dev_err(&pdev->dev, "failed to remap memory resource\n"); | ||
154 | return -ENOMEM; | ||
155 | } | ||
156 | |||
157 | ret = shmob_drm_setup_clocks(sdev, pdata->clk_source); | ||
158 | if (ret < 0) | ||
159 | return ret; | ||
160 | |||
161 | ret = shmob_drm_init_interface(sdev); | ||
162 | if (ret < 0) | ||
163 | return ret; | ||
164 | |||
165 | ret = shmob_drm_modeset_init(sdev); | ||
166 | if (ret < 0) { | ||
167 | dev_err(&pdev->dev, "failed to initialize mode setting\n"); | ||
168 | return ret; | ||
169 | } | ||
170 | |||
171 | for (i = 0; i < 4; ++i) { | ||
172 | ret = shmob_drm_plane_create(sdev, i); | ||
173 | if (ret < 0) { | ||
174 | dev_err(&pdev->dev, "failed to create plane %u\n", i); | ||
175 | goto done; | ||
176 | } | ||
177 | } | ||
178 | |||
179 | ret = drm_vblank_init(dev, 1); | ||
180 | if (ret < 0) { | ||
181 | dev_err(&pdev->dev, "failed to initialize vblank\n"); | ||
182 | goto done; | ||
183 | } | ||
184 | |||
185 | ret = drm_irq_install(dev, platform_get_irq(dev->platformdev, 0)); | ||
186 | if (ret < 0) { | ||
187 | dev_err(&pdev->dev, "failed to install IRQ handler\n"); | ||
188 | goto done; | ||
189 | } | ||
190 | |||
191 | platform_set_drvdata(pdev, sdev); | ||
192 | |||
193 | done: | ||
194 | if (ret) | ||
195 | shmob_drm_unload(dev); | ||
196 | |||
197 | return ret; | ||
198 | } | ||
199 | |||
200 | static irqreturn_t shmob_drm_irq(int irq, void *arg) | 106 | static irqreturn_t shmob_drm_irq(int irq, void *arg) |
201 | { | 107 | { |
202 | struct drm_device *dev = arg; | 108 | struct drm_device *dev = arg; |
@@ -236,8 +142,6 @@ static const struct file_operations shmob_drm_fops = { | |||
236 | static struct drm_driver shmob_drm_driver = { | 142 | static struct drm_driver shmob_drm_driver = { |
237 | .driver_features = DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET | 143 | .driver_features = DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET |
238 | | DRIVER_PRIME, | 144 | | DRIVER_PRIME, |
239 | .load = shmob_drm_load, | ||
240 | .unload = shmob_drm_unload, | ||
241 | .irq_handler = shmob_drm_irq, | 145 | .irq_handler = shmob_drm_irq, |
242 | .gem_free_object_unlocked = drm_gem_cma_free_object, | 146 | .gem_free_object_unlocked = drm_gem_cma_free_object, |
243 | .gem_vm_ops = &drm_gem_cma_vm_ops, | 147 | .gem_vm_ops = &drm_gem_cma_vm_ops, |
@@ -297,18 +201,116 @@ static const struct dev_pm_ops shmob_drm_pm_ops = { | |||
297 | * Platform driver | 201 | * Platform driver |
298 | */ | 202 | */ |
299 | 203 | ||
300 | static int shmob_drm_probe(struct platform_device *pdev) | 204 | static int shmob_drm_remove(struct platform_device *pdev) |
301 | { | 205 | { |
302 | return drm_platform_init(&shmob_drm_driver, pdev); | 206 | struct shmob_drm_device *sdev = platform_get_drvdata(pdev); |
207 | struct drm_device *ddev = sdev->ddev; | ||
208 | |||
209 | drm_dev_unregister(ddev); | ||
210 | drm_kms_helper_poll_fini(ddev); | ||
211 | drm_mode_config_cleanup(ddev); | ||
212 | drm_irq_uninstall(ddev); | ||
213 | drm_dev_unref(ddev); | ||
214 | |||
215 | return 0; | ||
303 | } | 216 | } |
304 | 217 | ||
305 | static int shmob_drm_remove(struct platform_device *pdev) | 218 | static int shmob_drm_probe(struct platform_device *pdev) |
306 | { | 219 | { |
307 | struct shmob_drm_device *sdev = platform_get_drvdata(pdev); | 220 | struct shmob_drm_platform_data *pdata = pdev->dev.platform_data; |
221 | struct shmob_drm_device *sdev; | ||
222 | struct drm_device *ddev; | ||
223 | struct resource *res; | ||
224 | unsigned int i; | ||
225 | int ret; | ||
226 | |||
227 | if (pdata == NULL) { | ||
228 | dev_err(&pdev->dev, "no platform data\n"); | ||
229 | return -EINVAL; | ||
230 | } | ||
308 | 231 | ||
309 | drm_put_dev(sdev->ddev); | 232 | /* |
233 | * Allocate and initialize the driver private data, I/O resources and | ||
234 | * clocks. | ||
235 | */ | ||
236 | sdev = devm_kzalloc(&pdev->dev, sizeof(*sdev), GFP_KERNEL); | ||
237 | if (sdev == NULL) | ||
238 | return -ENOMEM; | ||
239 | |||
240 | sdev->dev = &pdev->dev; | ||
241 | sdev->pdata = pdata; | ||
242 | spin_lock_init(&sdev->irq_lock); | ||
243 | |||
244 | platform_set_drvdata(pdev, sdev); | ||
245 | |||
246 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
247 | sdev->mmio = devm_ioremap_resource(&pdev->dev, res); | ||
248 | if (sdev->mmio == NULL) | ||
249 | return -ENOMEM; | ||
250 | |||
251 | ret = shmob_drm_setup_clocks(sdev, pdata->clk_source); | ||
252 | if (ret < 0) | ||
253 | return ret; | ||
254 | |||
255 | ret = shmob_drm_init_interface(sdev); | ||
256 | if (ret < 0) | ||
257 | return ret; | ||
258 | |||
259 | /* Allocate and initialize the DRM device. */ | ||
260 | ddev = drm_dev_alloc(&shmob_drm_driver, &pdev->dev); | ||
261 | if (IS_ERR(ddev)) | ||
262 | return PTR_ERR(ddev); | ||
263 | |||
264 | sdev->ddev = ddev; | ||
265 | ddev->dev_private = sdev; | ||
266 | |||
267 | ret = shmob_drm_modeset_init(sdev); | ||
268 | if (ret < 0) { | ||
269 | dev_err(&pdev->dev, "failed to initialize mode setting\n"); | ||
270 | goto err_free_drm_dev; | ||
271 | } | ||
272 | |||
273 | for (i = 0; i < 4; ++i) { | ||
274 | ret = shmob_drm_plane_create(sdev, i); | ||
275 | if (ret < 0) { | ||
276 | dev_err(&pdev->dev, "failed to create plane %u\n", i); | ||
277 | goto err_modeset_cleanup; | ||
278 | } | ||
279 | } | ||
280 | |||
281 | ret = drm_vblank_init(ddev, 1); | ||
282 | if (ret < 0) { | ||
283 | dev_err(&pdev->dev, "failed to initialize vblank\n"); | ||
284 | goto err_modeset_cleanup; | ||
285 | } | ||
286 | |||
287 | ret = drm_irq_install(ddev, platform_get_irq(pdev, 0)); | ||
288 | if (ret < 0) { | ||
289 | dev_err(&pdev->dev, "failed to install IRQ handler\n"); | ||
290 | goto err_vblank_cleanup; | ||
291 | } | ||
292 | |||
293 | /* | ||
294 | * Register the DRM device with the core and the connectors with | ||
295 | * sysfs. | ||
296 | */ | ||
297 | ret = drm_dev_register(ddev, 0); | ||
298 | if (ret < 0) | ||
299 | goto err_irq_uninstall; | ||
310 | 300 | ||
311 | return 0; | 301 | return 0; |
302 | |||
303 | err_irq_uninstall: | ||
304 | drm_irq_uninstall(ddev); | ||
305 | err_vblank_cleanup: | ||
306 | drm_vblank_cleanup(ddev); | ||
307 | err_modeset_cleanup: | ||
308 | drm_kms_helper_poll_fini(ddev); | ||
309 | drm_mode_config_cleanup(ddev); | ||
310 | err_free_drm_dev: | ||
311 | drm_dev_unref(ddev); | ||
312 | |||
313 | return ret; | ||
312 | } | 314 | } |
313 | 315 | ||
314 | static struct platform_driver shmob_drm_platform_driver = { | 316 | static struct platform_driver shmob_drm_platform_driver = { |
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index 3b15c2cb2306..6003c664ba0b 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c | |||
@@ -263,8 +263,6 @@ static int sti_bind(struct device *dev) | |||
263 | if (IS_ERR(ddev)) | 263 | if (IS_ERR(ddev)) |
264 | return PTR_ERR(ddev); | 264 | return PTR_ERR(ddev); |
265 | 265 | ||
266 | ddev->platformdev = to_platform_device(dev); | ||
267 | |||
268 | ret = sti_init(ddev); | 266 | ret = sti_init(ddev); |
269 | if (ret) | 267 | if (ret) |
270 | goto err_drm_dev_unref; | 268 | goto err_drm_dev_unref; |
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index 81d80a2ffeb1..5b4ed0ea7768 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c | |||
@@ -245,7 +245,6 @@ static int tilcdc_init(struct drm_driver *ddrv, struct device *dev) | |||
245 | if (IS_ERR(ddev)) | 245 | if (IS_ERR(ddev)) |
246 | return PTR_ERR(ddev); | 246 | return PTR_ERR(ddev); |
247 | 247 | ||
248 | ddev->platformdev = pdev; | ||
249 | ddev->dev_private = priv; | 248 | ddev->dev_private = priv; |
250 | platform_set_drvdata(pdev, ddev); | 249 | platform_set_drvdata(pdev, ddev); |
251 | drm_mode_config_init(ddev); | 250 | drm_mode_config_init(ddev); |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 4a0260e2b067..0e383438f793 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -501,7 +501,6 @@ struct drm_device { | |||
501 | struct pci_controller *hose; | 501 | struct pci_controller *hose; |
502 | #endif | 502 | #endif |
503 | 503 | ||
504 | struct platform_device *platformdev; /**< Platform device struture */ | ||
505 | struct virtio_device *virtdev; | 504 | struct virtio_device *virtdev; |
506 | 505 | ||
507 | struct drm_sg_mem *sg; /**< Scatter gather memory */ | 506 | struct drm_sg_mem *sg; /**< Scatter gather memory */ |
diff --git a/include/drm/drm_pci.h b/include/drm/drm_pci.h index 5081b3eba309..f5ebfcaf69e0 100644 --- a/include/drm/drm_pci.h +++ b/include/drm/drm_pci.h | |||
@@ -72,7 +72,4 @@ static inline int drm_pci_set_busid(struct drm_device *dev, | |||
72 | extern int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *speed_mask); | 72 | extern int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *speed_mask); |
73 | extern int drm_pcie_get_max_link_width(struct drm_device *dev, u32 *mlw); | 73 | extern int drm_pcie_get_max_link_width(struct drm_device *dev, u32 *mlw); |
74 | 74 | ||
75 | /* platform section */ | ||
76 | extern int drm_platform_init(struct drm_driver *driver, struct platform_device *platform_device); | ||
77 | |||
78 | #endif /* _DRM_PCI_H_ */ | 75 | #endif /* _DRM_PCI_H_ */ |