(Kyösti) some cleanups for 2.4+

Module refcounting using .owner, removing of inc/dec_use.
   These require (yet unreleased) i2c 2.8.0+.

   Named initializers everywhere. Unified namespace.

   Cleanup for 2.5, remove EXPORT_NO_SYMBOLS, declare everything
   static. Apply initcalls.

   PCI device registration changes for busses started, replicating
   from i2c-amd*. While everything does compile, nothing really
   works. Well, maybe i2c-amd* ported back from 2.5 tree.

   After updating your work directory, run
    > cvs diff -u -r LAST-PRE-2-8-I2C > lm-2.8-patches-1

   BEWARE: I have not even insmoded any of these yet.

   To compile, you need i2c from cvs too.
   For 2.4 kernel :
    > cvs co -r lk2-4 i2c

   For 2.5 kernel :
    > cvs co i2c


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1698 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Kyosti Malkki committed 2003-01-17 01:19:52 +00:00
1 parent 2a462eaae3
commit 39391ba6ea
59 files changed
+1596 -5391

No files matched your search

+14 -41
View File
@@ -315,62 +315,35 @@ static int ds1307_command (struct i2c_client *client,unsigned int cmd,void *arg)
return (-EINVAL);
}
static void ds1307_inc_use (struct i2c_client *client)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif /* #ifdef MODULE */
}
static void ds1307_dec_use (struct i2c_client *client)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif /* #ifdef MODULE */
}
static struct i2c_driver ds1307 = {
name: "ds1307",
id: I2C_DRIVERID_DS1307,
flags: I2C_DF_NOTIFY,
attach_adapter: ds1307_attach_adapter,
detach_client: ds1307_detach_client,
command: ds1307_command,
inc_use: ds1307_inc_use,
dec_use: ds1307_dec_use
.owner = THIS_MODULE,
.name = "ds1307",
.id = I2C_DRIVERID_DS1307,
.flags = I2C_DF_NOTIFY,
.attach_adapter = ds1307_attach_adapter,
.detach_client = ds1307_detach_client,
.command = ds1307_command,
};
static int __init ds1307_init (void)
static int __init sm_ds1307_init(void)
{
int result;
if ((result = i2c_add_driver (&ds1307)))
return (result);
printk ("Dallas Semiconductor DS1307 Real-Time Clock driver (V0.03)\n");
return (0);
return i2c_add_driver(&ds1307);
}
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
#undef __exit
#define __exit
#endif /* #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */
static void __exit ds1307_exit (void)
static void __exit sm_ds1307_exit(void)
{
i2c_del_driver (&ds1307);
i2c_del_driver(&ds1307);
}
EXPORT_NO_SYMBOLS;
MODULE_AUTHOR ("Abraham van der Merwe <abraham@2d3d.co.za>");
MODULE_DESCRIPTION ("Linux support for DS1307 Real-Time Clock");
#ifdef MODULE_LICENSE
MODULE_LICENSE ("GPL");
#endif /* #ifdef MODULE_LICENSE */
module_init (ds1307_init);
module_exit (ds1307_exit);
module_init(sm_ds1307_init);
module_exit(sm_ds1307_exit);