First step to make it possible to integrate lm_sensors modules into

the kernel.

* <kernel/init.h> is now included for all modules
* Initialization-time only functions and variables are marked with __init
* EXPORT_SYMBOL or EXPORT_NO_SYMBOLS declarations added


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@513 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Frodo Looijaard committed 1999-07-23 11:43:58 +00:00
1 parent 7de5a15384
commit fcbe78a669
25 files changed
+309 -133

No files matched your search

+13 -5
View File
@@ -82,6 +82,12 @@
#include <linux/bios32.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#endif
/* undefine this if separate ACPI software is accessing the
registers at the offset defined at 0x10.
*/
@@ -143,8 +149,8 @@
#define ALI15X3_STS_ERR 0xE0 /* all the bad error bits */
static int ali15x3_init(void);
static int ali15x3_cleanup(void);
static int __init ali15x3_init(void);
static int __init ali15x3_cleanup(void);
static int ali15x3_setup(void);
static s32 ali15x3_access(struct i2c_adapter *adap, u8 addr, char read_write,
u8 command, int size, union i2c_smbus_data * data);
@@ -179,7 +185,7 @@ static struct i2c_adapter ali15x3_adapter = {
NULL,
};
static int ali15x3_initialized;
static int __init ali15x3_initialized;
#ifdef MAP_ACPI
static unsigned short ali15x3_acpia = 0;
#endif
@@ -598,7 +604,7 @@ void ali15x3_dec(struct i2c_adapter *adapter)
MOD_DEC_USE_COUNT;
}
int ali15x3_init(void)
int __init ali15x3_init(void)
{
int res;
printk("ali15x3.o version %s (%s)\n",LM_VERSION,LM_DATE);
@@ -630,7 +636,7 @@ int ali15x3_init(void)
return 0;
}
int ali15x3_cleanup(void)
int __init ali15x3_cleanup(void)
{
int res;
if (ali15x3_initialized >= 2)
@@ -651,6 +657,8 @@ int ali15x3_cleanup(void)
return 0;
}
EXPORT_NO_SYMBOLS;
#ifdef MODULE
MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>, Philip Edelbrock <phil@netroedge.com>, and Mark D. Studebaker <mds@eng.paradyne.com>");
+8 -1
View File
@@ -39,6 +39,11 @@
#include <linux/bios32.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#endif
/* PCI device */
#define VENDOR PCI_VENDOR_ID_APPLE
@@ -171,7 +176,7 @@ static int find_hydra(void)
return 0;
}
int init_i2c_hydra(void)
int __init init_i2c_hydra(void)
{
if (find_hydra() < 0) {
printk("Error while reading PCI configuration\n");
@@ -190,6 +195,8 @@ int init_i2c_hydra(void)
}
}
EXPORT_NO_SYMBOLS;
#ifdef MODULE
MODULE_AUTHOR("Geert Uytterhoeven <geert@linux-m68k.org>");
MODULE_DESCRIPTION("i2c for Apple Hydra Mac I/O");
+13 -5
View File
@@ -29,14 +29,20 @@
#include <linux/i2c.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#endif
#include "version.h"
#include "i2c-isa.h"
static void isa_inc_use (struct i2c_adapter *adapter);
static void isa_dec_use (struct i2c_adapter *adapter);
static int isa_init(void);
static int isa_cleanup(void);
static int __init isa_init(void);
static int __init isa_cleanup(void);
#ifdef MODULE
extern int init_module(void);
@@ -66,7 +72,7 @@ static struct i2c_adapter isa_adapter = {
};
/* Used in isa_init/cleanup */
static int isa_initialized;
static int __init isa_initialized;
void isa_inc_use (struct i2c_adapter *adapter)
{
@@ -82,7 +88,7 @@ void isa_dec_use (struct i2c_adapter *adapter)
#endif
}
int isa_init(void)
int __init isa_init(void)
{
int res;
printk("i2c-isa.o version %s (%s)\n",LM_VERSION,LM_DATE);
@@ -110,7 +116,7 @@ int isa_init(void)
return 0;
}
int isa_cleanup(void)
int __init isa_cleanup(void)
{
int res;
if (isa_initialized >= 2)
@@ -132,6 +138,8 @@ int isa_cleanup(void)
return 0;
}
EXPORT_NO_SYMBOLS;
#ifdef MODULE
MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>");
+12 -5
View File
@@ -36,6 +36,11 @@
#include <linux/bios32.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#endif
/* PIIX4 SMBus address offsets */
#define SMBHSTSTS (0 + piix4_smba)
@@ -85,8 +90,8 @@ MODULE_PARM(force_addr,"i");
MODULE_PARM_DESC(force_addr,"Forcibly enable the PIIX4 at the given address. "
"EXTREMELY DANGEROUS!");
static int piix4_init(void);
static int piix4_cleanup(void);
static int __init piix4_init(void);
static int __init piix4_cleanup(void);
static int piix4_setup(void);
static s32 piix4_access(struct i2c_adapter *adap, u8 addr, char read_write,
u8 command, int size, union i2c_smbus_data * data);
@@ -121,7 +126,7 @@ static struct i2c_adapter piix4_adapter = {
NULL,
};
static int piix4_initialized;
static int __init piix4_initialized;
static unsigned short piix4_smba = 0;
@@ -435,7 +440,7 @@ void piix4_dec(struct i2c_adapter *adapter)
MOD_DEC_USE_COUNT;
}
int piix4_init(void)
int __init piix4_init(void)
{
int res;
printk("piix4.o version %s (%s)\n",LM_VERSION,LM_DATE);
@@ -464,7 +469,7 @@ int piix4_init(void)
return 0;
}
int piix4_cleanup(void)
int __init piix4_cleanup(void)
{
int res;
if (piix4_initialized >= 2)
@@ -482,6 +487,8 @@ int piix4_cleanup(void)
return 0;
}
EXPORT_NO_SYMBOLS;
#ifdef MODULE
MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl> and Philip Edelbrock <phil@netroedge.com>");
+9 -1
View File
@@ -33,6 +33,12 @@
#include <linux/bios32.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#endif
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
#include "compat.h"
@@ -204,7 +210,7 @@ static int find_via(void)
}
#endif
static int init_i2c_via(void)
static int __init init_i2c_via(void)
{
if (find_via() < 0) {
printk("Error while reading PCI configuration\n");
@@ -232,6 +238,8 @@ static int init_i2c_via(void)
}
}
EXPORT_NO_SYMBOLS;
#ifdef MODULE
MODULE_AUTHOR("Kyösti Mälkki <kmalkki@cc.hut.fi>");
MODULE_DESCRIPTION("i2c for Via vt82c586b southbridge");
+15 -5
View File
@@ -36,6 +36,13 @@
#include <linux/bios32.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#endif
#ifndef PCI_DEVICE_ID_VIA_82C596_3
#define PCI_DEVICE_ID_VIA_82C596_3 0x3050
#endif
@@ -100,8 +107,8 @@ MODULE_PARM(force_addr,"i");
MODULE_PARM_DESC(force_addr,"Forcibly enable the VT82C596 SMBus at the given address. "
"EXTREMELY DANGEROUS!");
static int vt596_init(void);
static int vt596_cleanup(void);
static int __init vt596_init(void);
static int __init vt596_cleanup(void);
static int vt596_setup(void);
static s32 vt596_access(struct i2c_adapter *adap, u8 addr, char read_write,
u8 command, int size, union i2c_smbus_data * data);
@@ -136,7 +143,7 @@ static struct i2c_adapter vt596_adapter = {
NULL,
};
static int vt596_initialized;
static int __init vt596_initialized;
static unsigned short vt596_smba = 0;
@@ -470,7 +477,7 @@ void vt596_dec(struct i2c_adapter *adapter)
MOD_DEC_USE_COUNT;
}
int vt596_init(void)
int __init vt596_init(void)
{
int res;
printk("via2.o version %s (%s)\n",LM_VERSION,LM_DATE);
@@ -499,7 +506,7 @@ int vt596_init(void)
return 0;
}
int vt596_cleanup(void)
int __init vt596_cleanup(void)
{
int res;
if (vt596_initialized >= 2)
@@ -517,11 +524,14 @@ int vt596_cleanup(void)
return 0;
}
EXPORT_NO_SYMBOLS;
#ifdef MODULE
MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl> and Philip Edelbrock <phil@netroedge.com>");
MODULE_DESCRIPTION("vt82c596 SMBus driver");
int init_module(void)
{
return vt596_init();
+15 -5
View File
@@ -36,6 +36,13 @@
#include <linux/bios32.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#endif
#ifndef PCI_DEVICE_ID_VIA_82C596_3
#define PCI_DEVICE_ID_VIA_82C596_3 0x3050
#endif
@@ -100,8 +107,8 @@ MODULE_PARM(force_addr,"i");
MODULE_PARM_DESC(force_addr,"Forcibly enable the VT82C596 SMBus at the given address. "
"EXTREMELY DANGEROUS!");
static int vt596_init(void);
static int vt596_cleanup(void);
static int __init vt596_init(void);
static int __init vt596_cleanup(void);
static int vt596_setup(void);
static s32 vt596_access(struct i2c_adapter *adap, u8 addr, char read_write,
u8 command, int size, union i2c_smbus_data * data);
@@ -136,7 +143,7 @@ static struct i2c_adapter vt596_adapter = {
NULL,
};
static int vt596_initialized;
static int __init vt596_initialized;
static unsigned short vt596_smba = 0;
@@ -470,7 +477,7 @@ void vt596_dec(struct i2c_adapter *adapter)
MOD_DEC_USE_COUNT;
}
int vt596_init(void)
int __init vt596_init(void)
{
int res;
printk("via2.o version %s (%s)\n",LM_VERSION,LM_DATE);
@@ -499,7 +506,7 @@ int vt596_init(void)
return 0;
}
int vt596_cleanup(void)
int __init vt596_cleanup(void)
{
int res;
if (vt596_initialized >= 2)
@@ -517,11 +524,14 @@ int vt596_cleanup(void)
return 0;
}
EXPORT_NO_SYMBOLS;
#ifdef MODULE
MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl> and Philip Edelbrock <phil@netroedge.com>");
MODULE_DESCRIPTION("vt82c596 SMBus driver");
int init_module(void)
{
return vt596_init();
+14 -19
View File
@@ -44,6 +44,12 @@
#include <linux/bios32.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#endif
/* 3DFX defines */
#ifndef PCI_VENDOR_ID_3DFX
#define PCI_VENDOR_ID_3DFX 0x121a
@@ -52,8 +58,8 @@
#define PCI_DEVICE_ID_3DFX_VOODOO3 0x05
#endif
static int voodoo3_init(void);
static int voodoo3_cleanup(void);
static int __init voodoo3_init(void);
static int __init voodoo3_cleanup(void);
static int voodoo3_setup(void);
static s32 voodoo3_access(struct i2c_adapter *adap, u8 addr, char read_write,
u8 command, int size, union i2c_smbus_data * data);
@@ -73,20 +79,6 @@ static void config_v3(struct pci_dev *dev, int num);
static void voodoo3_inc(struct i2c_adapter *adapter);
static void voodoo3_dec(struct i2c_adapter *adapter);
#ifdef MODULE
extern int init_module(void);
extern int cleanup_module(void);
@@ -113,7 +105,7 @@ static struct i2c_adapter voodoo3_adapter = {
NULL,
};
static int voodoo3_initialized;
static int __init voodoo3_initialized;
static unsigned short voodoo3_smba = 0;
static unsigned int state=0xcf980020;
static unsigned char *mem;
@@ -533,7 +525,7 @@ void voodoo3_dec(struct i2c_adapter *adapter)
MOD_DEC_USE_COUNT;
}
int voodoo3_init(void)
int __init voodoo3_init(void)
{
int res;
printk("i2c-voodoo3.o version %s (%s)\n",LM_VERSION,LM_DATE);
@@ -562,7 +554,7 @@ int voodoo3_init(void)
return 0;
}
int voodoo3_cleanup(void)
int __init voodoo3_cleanup(void)
{
int res;
@@ -581,11 +573,14 @@ int voodoo3_cleanup(void)
return 0;
}
EXPORT_NO_SYMBOLS;
#ifdef MODULE
MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl> and Philip Edelbrock <phil@netroedge.com> and Ralph Metzler <rjkm@thp.uni-koeln.de>");
MODULE_DESCRIPTION("Voodoo3 I2C/SMBus driver");
int init_module(void)
{
return voodoo3_init();