lkml.org 
[lkml]   [2000]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] driver/char/Makefile cleanup and bugfix
On Fri, 04 Aug 2000 around 14:12:04 -0500, Michael Elizabeth Chastain wrote:
> Hi Pauline,
>
> That stripping happens in the rule for building $(O_TARGET):
>
> # Rules.make
> $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(ALL_O), $^)

Perfect.

Below a simple patch which adopts more of the char Makefile
to the new system. The patch also corrects the non-initialisation
of i2c-old which is kind of important for the old-type i2c
users when they link it in.

Met vriendelijke groet,
Pauline Middelink
--
PGP Key fingerprint = DE 6B D0 D9 19 AD A7 A0 58 A3 06 9D B6 34 39 E2
For more details look at my website http://www.polyware.nl/~middelink
diff -ur -x *.o linux-2.4.0-test5-bigphys.orig/drivers/char/Makefile linux-2.4.0-test5-bigphys/drivers/char/Makefile
--- linux-2.4.0-test5-bigphys.orig/drivers/char/Makefile Mon Jul 31 14:58:15 2000
+++ linux-2.4.0-test5-bigphys/drivers/char/Makefile Sat Aug 5 10:23:48 2000
@@ -40,8 +40,9 @@
misc.o pty.o random.o selection.o serial.o videodev.o \
tty_io.o bttv-if.o cpia.o

-list-multi := bttv.o
+list-multi := bttv.o zoran.o
bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o
+zoran-objs := zr36120.o zr36120_i2c.o zr36120_mem.o

KEYMAP =defkeymap.o
KEYBD =pc_keyb.o
@@ -206,68 +207,23 @@
#
# for external dependencies in arm/config.in and video/config.in
#
-ifeq ($(CONFIG_BUS_I2C),y)
- L_I2C=y
-else
- ifeq ($(CONFIG_BUS_I2C),m)
- L_I2C=m
- endif
-endif
+obj-$(CONFIG_BUS_I2C) += i2c_old.o

-obj-$(CONFIG_VIDEO_BT848) += bttv.o msp3400.o \
+obj-$(CONFIG_VIDEO_BT848) += bttv.o tuner.o msp3400.o \
tda7432.o tda8425.o tda985x.o tda9875.o tea6300.o tea6420.o
-ifeq ($(CONFIG_VIDEO_BT848),y)
-L_TUNERS=y
-else
- ifeq ($(CONFIG_VIDEO_BT848),m)
- L_TUNERS=m
- endif
-endif
+
obj-$(CONFIG_SOUND_TVMIXER) += tvmixer.o

-obj-$(CONFIG_VIDEO_ZR36120) += zoran.o
-ifeq ($(CONFIG_VIDEO_ZR36120),y)
-L_I2C=y
-L_TUNERS=y
-L_DECODERS=y
-else
- ifeq ($(CONFIG_VIDEO_ZR36120),m)
- L_I2C=m
- L_TUNERS=m
- L_DECODERS=m
- endif
-endif
+obj-$(CONFIG_VIDEO_ZR36120) += i2c-old.o tuner.o \
+ zoran.o saa7110.o saa7111.o saa7185.o

-obj-$(CONFIG_I2C_PARPORT) += i2c-parport.o
-ifeq ($(CONFIG_I2C_PARPORT),y)
-L_I2C = y
-else
- ifeq ($(CONFIG_I2C_PARPORT),m)
- L_I2C = m
- endif
-endif
+obj-$(CONFIG_I2C_PARPORT) += i2c-old.o i2c-parport.o

-obj-$(CONFIG_VIDEO_SAA5249) += saa5249.o
-ifeq ($(CONFIG_VIDEO_SAA5249),y)
-L_I2C=y
-else
- ifeq ($(CONFIG_VIDEO_SAA5249),m)
- L_I2C=m
- endif
-endif
+obj-$(CONFIG_VIDEO_SAA5249) += i2c-old.o saa5249.o

obj-$(CONFIG_VIDEO_CQCAM) += c-qcam.o
obj-$(CONFIG_VIDEO_BWQCAM) += bw-qcam.o
-obj-$(CONFIG_VIDEO_ZORAN) += buz.o
-ifeq ($(CONFIG_VIDEO_ZORAN),y)
-L_I2C=y
-L_DECODERS=y
-else
- ifeq ($(CONFIG_VIDEO_ZORAN),m)
- L_I2C=m
- L_DECODERS=m
- endif
-endif
+obj-$(CONFIG_VIDEO_ZORAN) += i2c-old.o buz.o saa7110.o saa7111.o saa7185.o

obj-$(CONFIG_VIDEO_LML33) += bt856.o bt819.o
obj-$(CONFIG_VIDEO_PMS) += pms.o
@@ -292,29 +248,20 @@
obj-$(CONFIG_QIC02_TAPE) += tpqic02.o

ifeq ($(CONFIG_FTAPE),y)
-obj-y += ftape/ftape.o
-SUB_DIRS += ftape
-ifneq ($(CONFIG_ZFTAPE),n)
-MOD_SUB_DIRS += ftape
-endif
-else
- ifeq ($(CONFIG_FTAPE),m)
- MOD_SUB_DIRS += ftape
- endif
+ obj-y += ftape/ftape.o
+ SUB_DIRS += ftape
+ ifneq ($(CONFIG_ZFTAPE),n)
+ MOD_SUB_DIRS += ftape
+ endif
+ else
+ ifeq ($(CONFIG_FTAPE),m)
+ MOD_SUB_DIRS += ftape
+ endif
endif

obj-$(CONFIG_H8) += h8.o
obj-$(CONFIG_PPDEV) += ppdev.o

-# set when a framegrabber supports external tuners
-obj-$(L_TUNERS) += tuner.o
-
-# set when a framegrabber supports external decoders
-obj-$(L_DECODERS) += saa7110.o saa7111.o saa7185.o
-
-# set when a framegrabber implements i2c support
-obj-$(L_I2C) += i2c-old.o
-
obj-$(CONFIG_DZ) += dz.o
obj-$(CONFIG_NWBUTTON) += nwbutton.o
obj-$(CONFIG_NWFLASH) += nwflash.o
@@ -386,9 +333,14 @@
defkeymap.c: defkeymap.map
loadkeys --mktable defkeymap.map > defkeymap.c

-zoran.o: zr36120.o zr36120_i2c.o zr36120_mem.o
- $(LD) $(LD_RFLAG) -r -o $@ zr36120.o zr36120_i2c.o zr36120_mem.o
+zoran.o: $(zoran-objs)
+ $(LD) $(LD_RFLAG) -r -o $@ $(zoran-objs)

bttv.o: $(bttv-objs)
$(LD) $(LD_RFLAG) -r -o $@ $(bttv-objs)

+# only init i2c_old when its actual linked in.
+# pretty gross, but there is no CONFIG_I2C_OLD and never will be
+ifneq (,$(findstring i2c-old.o,$(obj-y)))
+CFLAGS_mem.o := -DCONFIG_I2C_OLD=y
+endif
diff -ur -x *.o linux-2.4.0-test5-bigphys.orig/drivers/char/i2c-old.c linux-2.4.0-test5-bigphys/drivers/char/i2c-old.c
--- linux-2.4.0-test5-bigphys.orig/drivers/char/i2c-old.c Tue Dec 21 16:54:39 1999
+++ linux-2.4.0-test5-bigphys/drivers/char/i2c-old.c Sat Aug 5 09:52:42 2000
@@ -36,10 +36,6 @@
static struct i2c_driver *drivers[I2C_DRIVER_MAX];
static int bus_count = 0, driver_count = 0;

-#ifdef CONFIG_VIDEO_BT848
-extern int i2c_tuner_init(void);
-extern int msp3400c_init(void);
-#endif
#ifdef CONFIG_VIDEO_BUZ
extern int saa7111_init(void);
extern int saa7185_init(void);
@@ -49,15 +45,11 @@
extern int bt856_init(void);
#endif

-int i2c_init(void)
+int i2c_init_old(void)
{
printk(KERN_INFO "i2c: initialized%s\n",
scan ? " (i2c bus scan enabled)" : "");
/* anything to do here ? */
-#ifdef CONFIG_VIDEO_BT848
- i2c_tuner_init();
- msp3400c_init();
-#endif
#ifdef CONFIG_VIDEO_BUZ
saa7111_init();
saa7185_init();
@@ -449,7 +441,7 @@

int init_module(void)
{
- return i2c_init();
+ return i2c_init_old();
}

void cleanup_module(void)
diff -ur -x *.o linux-2.4.0-test5-bigphys.orig/drivers/char/mem.c linux-2.4.0-test5-bigphys/drivers/char/mem.c
--- linux-2.4.0-test5-bigphys.orig/drivers/char/mem.c Tue Jul 18 09:14:24 2000
+++ linux-2.4.0-test5-bigphys/drivers/char/mem.c Sat Aug 5 09:57:12 2000
@@ -28,6 +28,9 @@
#ifdef CONFIG_I2C
extern int i2c_init_all(void);
#endif
+#ifdef CONFIG_I2C_OLD
+extern int i2c_init_old(void);
+#endif
#ifdef CONFIG_SOUND
void soundcore_init(void);
#ifdef CONFIG_SOUND_OSS
@@ -624,6 +627,9 @@
raw_init();
#ifdef CONFIG_I2C
i2c_init_all();
+#endif
+#ifdef CONFIG_I2C_OLD
+ i2c_init_old();
#endif
#if defined (CONFIG_FB)
fbmem_init();
\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.036 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site