From: Frank Mori Hess Date: Mon, 31 May 2004 21:44:53 +0000 (+0000) Subject: add 2.4 compatibility for pcmcia_register_driver() and pcmcia_unregister_driver() X-Git-Tag: r0_7_69~49 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8c418ca96bd69424c3f02da240c800288439e3a4;p=comedi.git add 2.4 compatibility for pcmcia_register_driver() and pcmcia_unregister_driver() --- diff --git a/include/linux/device.h b/include/linux/device.h new file mode 100644 index 00000000..3631fd51 --- /dev/null +++ b/include/linux/device.h @@ -0,0 +1,20 @@ +/* + * linux/device.h compatibility header + */ + +#ifndef __COMPAT_LINUX_DEVICE_H_ +#define __COMPAT_LINUX_DEVICE_H_ + +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +struct device_driver +{ + char * name; +}; +#else +#include_next +#endif + +#endif // __COMPAT_LINUX_DEVICE_H_ + diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h new file mode 100644 index 00000000..8de9f000 --- /dev/null +++ b/include/pcmcia/ds.h @@ -0,0 +1,35 @@ +/* + * pcmcia/ds.h compatibility header + */ + +#ifndef __COMPAT_PCMCIA_DS_H_ +#define __COMPAT_PCMCIA_DS_H_ + +#include +#include_next +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +struct pcmcia_driver { + dev_link_t *(*attach)(void); + void (*detach)(dev_link_t *); + struct module *owner; + struct device_driver drv; +}; + +/* driver registration */ +static inline int pcmcia_register_driver(struct pcmcia_driver *driver) +{ + return register_pccard_driver(driver->drv.name, driver->attach, driver->detach); +} + +static void inline pcmcia_unregister_driver(struct pcmcia_driver *driver) +{ + unregister_pccard_driver(driver->drv.name); +} + + +#endif + +#endif // __COMPAT_PCMCIA_DS_H_ +