]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
[media] move i2c files into drivers/media/i2c
authorMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 24 Aug 2012 22:44:44 +0000 (19:44 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 6 Sep 2012 21:42:54 +0000 (18:42 -0300)
Based on a patch from Sylvester Nawrocki

This fixes regression introduced with commmit cb7a01ac324bf2ee2,
"[media] move i2c files into drivers/media/i2c".

The linked order affect what drivers will be initialized first, when
they're built-in at Kernel. While there are macros that allow changing
the init order, like subsys_initcall(), late_initcall() & friends,
when all drivers  linked belong to the same subsystem, it is easier
to change the order at the Makefile.

All I2C modules must be linked before any drivers that actually use it,
in order to ensure proper module initialization order.

Also, the core drivers should be initialized before the drivers that use
them.

This patch reorders the drivers init, in order to fulfill the above
requirements.

Reported-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Acked-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/Makefile

index b0b0193cd69d88e38823a6ca4a314139c70fa377..620f275a45c9903069a1ebd7bb24370de71f3f4e 100644 (file)
@@ -4,12 +4,30 @@
 
 media-objs     := media-device.o media-devnode.o media-entity.o
 
+#
+# I2C drivers should come before other drivers, otherwise they'll fail
+# when compiled as builtin drivers
+#
+obj-y += i2c/ tuners/
+obj-$(CONFIG_DVB_CORE)  += dvb-frontends/
+
+#
+# Now, let's link-in the media core
+#
 ifeq ($(CONFIG_MEDIA_CONTROLLER),y)
   obj-$(CONFIG_MEDIA_SUPPORT) += media.o
 endif
 
-obj-y += tuners/ common/ rc/ platform/
-obj-y += i2c/ pci/ usb/ mmc/ firewire/ parport/
+obj-$(CONFIG_VIDEO_DEV) += v4l2-core/
+obj-$(CONFIG_DVB_CORE)  += dvb-core/
+
+# There are both core and drivers at RC subtree - merge before drivers
+obj-y += rc/
+
+#
+# Finally, merge the drivers that require the core
+#
+
+obj-y += common/ platform/ pci/ usb/ mmc/ firewire/ parport/
+obj-$(CONFIG_VIDEO_DEV) += radio/
 
-obj-$(CONFIG_VIDEO_DEV) += radio/ v4l2-core/
-obj-$(CONFIG_DVB_CORE)  += dvb-core/ dvb-frontends/