Skip to content

Commit dcec16e

Browse files
thierryredingvinceab
authored andcommitted
drm/sti: Build monolithic driver
There's no use building the individual drivers as separate modules because they are all only useful if combined into a single DRM/KMS device. Cc: Benjamin Gaignard <[email protected]> Cc: Vincent Abriou <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Reviewed-by: Vincent Abriou <[email protected]>
1 parent 2388693 commit dcec16e

File tree

11 files changed

+42
-30
lines changed

11 files changed

+42
-30
lines changed

drivers/gpu/drm/sti/Makefile

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
1-
sticompositor-y := \
1+
sti-drm-y := \
22
sti_mixer.o \
33
sti_gdp.o \
44
sti_vid.o \
55
sti_cursor.o \
66
sti_compositor.o \
77
sti_crtc.o \
8-
sti_plane.o
9-
10-
stihdmi-y := sti_hdmi.o \
8+
sti_plane.o \
9+
sti_crtc.o \
10+
sti_plane.o \
11+
sti_hdmi.o \
1112
sti_hdmi_tx3g0c55phy.o \
1213
sti_hdmi_tx3g4c28phy.o \
13-
14-
stidvo-y := sti_dvo.o \
15-
sti_awg_utils.o
16-
17-
obj-$(CONFIG_DRM_STI) = \
14+
sti_dvo.o \
15+
sti_awg_utils.o \
1816
sti_vtg.o \
1917
sti_vtac.o \
20-
stihdmi.o \
2118
sti_hda.o \
2219
sti_tvout.o \
23-
sticompositor.o \
2420
sti_hqvdp.o \
25-
stidvo.o \
2621
sti_drv.o
22+
23+
obj-$(CONFIG_DRM_STI) = sti-drm.o

drivers/gpu/drm/sti/sti_compositor.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ static int sti_compositor_remove(struct platform_device *pdev)
263263
return 0;
264264
}
265265

266-
static struct platform_driver sti_compositor_driver = {
266+
struct platform_driver sti_compositor_driver = {
267267
.driver = {
268268
.name = "sti-compositor",
269269
.of_match_table = compositor_of_match,
@@ -272,8 +272,6 @@ static struct platform_driver sti_compositor_driver = {
272272
.remove = sti_compositor_remove,
273273
};
274274

275-
module_platform_driver(sti_compositor_driver);
276-
277275
MODULE_AUTHOR("Benjamin Gaignard <[email protected]>");
278276
MODULE_DESCRIPTION("STMicroelectronics SoC DRM driver");
279277
MODULE_LICENSE("GPL");

drivers/gpu/drm/sti/sti_drv.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,29 @@ static struct platform_driver sti_platform_driver = {
287287
},
288288
};
289289

290-
module_platform_driver(sti_platform_driver);
290+
static struct platform_driver * const drivers[] = {
291+
&sti_tvout_driver,
292+
&sti_vtac_driver,
293+
&sti_hqvdp_driver,
294+
&sti_hdmi_driver,
295+
&sti_hda_driver,
296+
&sti_dvo_driver,
297+
&sti_vtg_driver,
298+
&sti_compositor_driver,
299+
&sti_platform_driver,
300+
};
301+
302+
static int sti_drm_init(void)
303+
{
304+
return platform_register_drivers(drivers, ARRAY_SIZE(drivers));
305+
}
306+
module_init(sti_drm_init);
307+
308+
static void sti_drm_exit(void)
309+
{
310+
platform_unregister_drivers(drivers, ARRAY_SIZE(drivers));
311+
}
312+
module_exit(sti_drm_exit);
291313

292314
MODULE_AUTHOR("Benjamin Gaignard <[email protected]>");
293315
MODULE_DESCRIPTION("STMicroelectronics SoC DRM driver");

drivers/gpu/drm/sti/sti_drv.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,13 @@ struct sti_private {
3232
} commit;
3333
};
3434

35+
extern struct platform_driver sti_tvout_driver;
36+
extern struct platform_driver sti_vtac_driver;
37+
extern struct platform_driver sti_hqvdp_driver;
38+
extern struct platform_driver sti_hdmi_driver;
39+
extern struct platform_driver sti_hda_driver;
40+
extern struct platform_driver sti_dvo_driver;
41+
extern struct platform_driver sti_vtg_driver;
42+
extern struct platform_driver sti_compositor_driver;
43+
3544
#endif

drivers/gpu/drm/sti/sti_dvo.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,6 @@ struct platform_driver sti_dvo_driver = {
558558
.remove = sti_dvo_remove,
559559
};
560560

561-
module_platform_driver(sti_dvo_driver);
562-
563561
MODULE_AUTHOR("Benjamin Gaignard <[email protected]>");
564562
MODULE_DESCRIPTION("STMicroelectronics SoC DRM driver");
565563
MODULE_LICENSE("GPL");

drivers/gpu/drm/sti/sti_hda.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,8 +785,6 @@ struct platform_driver sti_hda_driver = {
785785
.remove = sti_hda_remove,
786786
};
787787

788-
module_platform_driver(sti_hda_driver);
789-
790788
MODULE_AUTHOR("Benjamin Gaignard <[email protected]>");
791789
MODULE_DESCRIPTION("STMicroelectronics SoC DRM driver");
792790
MODULE_LICENSE("GPL");

drivers/gpu/drm/sti/sti_hdmi.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,8 +902,6 @@ struct platform_driver sti_hdmi_driver = {
902902
.remove = sti_hdmi_remove,
903903
};
904904

905-
module_platform_driver(sti_hdmi_driver);
906-
907905
MODULE_AUTHOR("Benjamin Gaignard <[email protected]>");
908906
MODULE_DESCRIPTION("STMicroelectronics SoC DRM driver");
909907
MODULE_LICENSE("GPL");

drivers/gpu/drm/sti/sti_hqvdp.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,8 +1090,6 @@ struct platform_driver sti_hqvdp_driver = {
10901090
.remove = sti_hqvdp_remove,
10911091
};
10921092

1093-
module_platform_driver(sti_hqvdp_driver);
1094-
10951093
MODULE_AUTHOR("Benjamin Gaignard <[email protected]>");
10961094
MODULE_DESCRIPTION("STMicroelectronics SoC DRM driver");
10971095
MODULE_LICENSE("GPL");

drivers/gpu/drm/sti/sti_tvout.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,6 @@ struct platform_driver sti_tvout_driver = {
735735
.remove = sti_tvout_remove,
736736
};
737737

738-
module_platform_driver(sti_tvout_driver);
739-
740738
MODULE_AUTHOR("Benjamin Gaignard <[email protected]>");
741739
MODULE_DESCRIPTION("STMicroelectronics SoC DRM driver");
742740
MODULE_LICENSE("GPL");

drivers/gpu/drm/sti/sti_vtac.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@ struct platform_driver sti_vtac_driver = {
216216
.remove = sti_vtac_remove,
217217
};
218218

219-
module_platform_driver(sti_vtac_driver);
220-
221219
MODULE_AUTHOR("Benjamin Gaignard <[email protected]>");
222220
MODULE_DESCRIPTION("STMicroelectronics SoC DRM driver");
223221
MODULE_LICENSE("GPL");

drivers/gpu/drm/sti/sti_vtg.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,6 @@ struct platform_driver sti_vtg_driver = {
406406
.remove = vtg_remove,
407407
};
408408

409-
module_platform_driver(sti_vtg_driver);
410-
411409
MODULE_AUTHOR("Benjamin Gaignard <[email protected]>");
412410
MODULE_DESCRIPTION("STMicroelectronics SoC DRM driver");
413411
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)