Hello,
On kernel 2.6.21, compilation of drivers results in the following errors.
include/linux/pci.h: In function 'pci_register_driver':
include/linux/pci.h:595: error: 'KBUILD_MODNAME' undeclared (first use
in this function)
include/linux/pci.h:595: error: (Each undeclared identifier is
reported only once
include/linux/pci.h:595: error: for each function it appears in.)
It appears that kbuild has changed a bit. I could not find much
information on this. Most of the links talk about adding a CFLAG with a
name for KBUILD_MODNAME. I have attached the Makefile if anybody wants
to look through. Please let me know what changes need to be made.
Thanks very much. Any ideas would be appreciated.
Dinesh
# Makefile for the Master Linux drivers and APIs
ifneq ($(KERNELRELEASE),)
obj-m := asi.o dvbm.o sdi.o sdim.o sdilpm.o mmas.o mmsa.o \
ls_as.o ls_jtag.o sdimqie.o
asi-objs := asicore.o miface.o
dvbm-objs := dvbmaster.o mdev.o plx9080.o gt64131.o masterplx.o lsdma.o masterlsdma.o \
dvbm_fd.o dvbm_fdu.o dvbm_rx.o dvbm_rxu.o dvbm_tx.o dvbm_txu.o \
dvbm_lpfd.o dvbm_qlf.o dvbm_qi.o dvbm_qo.o dvbm_qdual.o
ls_as-objs := asmi.o eeprom.o
ls_jtag-objs := jtag.o eeprom.o
sdi-objs := sdicore.o miface.o
sdim-objs := sdimaster.o mdev.o plx9080.o masterplx.o
sdilpm-objs := sdim_lpfd.o mdev.o lsdma.o masterlsdma.o
sdimqie-objs := sdim_qie.o mdev.o lsdma.o masterlsdma.o plx9080.o masterplx.o
mmas-objs := as.o mdev.o plx9080.o masterplx.o
mmsa-objs := sa.o mdev.o plx9080.o masterplx.o
else
SHELL = /bin/sh
INSTALL = install
DEPMOD = /sbin/depmod
.SUFFIXES:
.SUFFIXES: .c .o
.PHONY: all clean install uninstall
KERNELPTR := /lib/modules/$(shell uname -r)/build
KERNELSRC := $(shell if [ -e $(KERNELPTR) ]; then echo $(KERNELPTR); fi)
ifeq ($(KERNELSRC),)
$(error $(KERNELPTR) not found)
endif
PWD := $(shell pwd)
INSTALLDIR := /lib/modules/$(shell uname -r)/master
TARGETS = asi.ko dvbm.ko sdi.ko sdim.ko sdilpm.ko sdim_qie.ko mmas.ko mmsa.ko
all:
$(MAKE) -C $(KERNELSRC) SUBDIRS=$(PWD) modules
clean:
$(RM) *.o *.ko *.mod.c .*.cmd Module.symvers
$(RM) -r .tmp_versions
install: all
$(INSTALL) -d $(INSTALLDIR)
$(INSTALL) -m 0744 $(TARGETS) $(INSTALLDIR)
$(DEPMOD) -a
uninstall:
$(RM) $(foreach module,$(TARGETS),$(INSTALLDIR)/$(module))
$(DEPMOD) -a
rmdir $(INSTALLDIR)
endif