• R/O
  • HTTP
  • SSH
  • HTTPS

linux-2.4.36: コミット

2.4.36-stable kernel tree


コミットメタ情報

リビジョンb498501d3c388903c5daa26634e1225116ca4228 (tree)
日時2006-12-05 17:22:47
作者Jean Delvare <khali@linu...>
コミッターWilly Tarreau

ログメッセージ

[PATCH] i2c cleanup : typos and whitespace

Trivial changes picked from the i2c SVN repository. This includes:
* Documentation updates
* Comment updates
* Whitespace changes
* Typo fixes in strings and comments
* Includes reordering
* Drop of includes and comments relative to kernel version 2.0 to 2.3
The idea is to minimize the meaningless differences between both theres
so that real differences are easier to see.

Signed-off-by: Jean Delvare <khali@linux-fr.org>

変更サマリ

差分

--- a/Documentation/i2c/dev-interface
+++ b/Documentation/i2c/dev-interface
@@ -92,10 +92,10 @@ ioctl(file,I2C_TENBIT,long select)
9292 ioctl(file,I2C_FUNCS,unsigned long *funcs)
9393 Gets the adapter functionality and puts it in *funcs.
9494
95-ioctl(file,I2C_RDWR,struct i2c_ioctl_rdwr_data *msgset)
95+ioctl(file,I2C_RDWR,struct i2c_rdwr_ioctl_data *msgset)
9696
9797 Do combined read/write transaction without stop in between.
98- The argument is a pointer to a struct i2c_ioctl_rdwr_data {
98+ The argument is a pointer to a struct i2c_rdwr_ioctl_data {
9999
100100 struct i2c_msg *msgs; /* ptr to array of simple messages */
101101 int nmsgs; /* number of messages to exchange */
--- a/Documentation/i2c/functionality
+++ b/Documentation/i2c/functionality
@@ -17,8 +17,8 @@ For the most up-to-date list of functionality constants, please check
1717 I2C_FUNC_I2C Plain i2c-level commands (Pure SMBus
1818 adapters typically can not do these)
1919 I2C_FUNC_10BIT_ADDR Handles the 10-bit address extensions
20- I2C_FUNC_PROTOCOL_MANGLING Knows about the I2C_M_REV_DIR_ADDR,
21- I2C_M_REV_DIR_ADDR and I2C_M_REV_DIR_NOSTART
20+ I2C_FUNC_PROTOCOL_MANGLING Knows about the
21+ I2C_M_REV_DIR_ADDR and I2C_M_NOSTART
2222 flags (which modify the i2c protocol!)
2323 I2C_FUNC_SMBUS_QUICK Handles the SMBus write_quick command
2424 I2C_FUNC_SMBUS_READ_BYTE Handles the SMBus read_byte command
@@ -115,7 +115,7 @@ CHECKING THROUGH /DEV
115115 If you try to access an adapter from a userspace program, you will have
116116 to use the /dev interface. You will still have to check whether the
117117 functionality you need is supported, of course. This is done using
118-the I2C_FUNCS ioctl. An example, adapted from the lm_sensors i2c_detect
118+the I2C_FUNCS ioctl. An example, adapted from the lm_sensors i2cdetect
119119 program, is below:
120120
121121 int file;
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -28,14 +28,14 @@ static struct i2c_driver foo_driver = {
2828 .name = "Foo version 2.3 driver",
2929 .id = I2C_DRIVERID_FOO, /* from i2c-id.h, optional */
3030 .flags = I2C_DF_NOTIFY,
31- .attach_adapter = &foo_attach_adapter,
32- .detach_client = &foo_detach_client,
33- .command = &foo_command, /* may be NULL */
34- .inc_use = &foo_inc_use, /* May be NULL */
35- .dec_use = &foo_dec_use, /* May be NULL */
31+ .attach_adapter = foo_attach_adapter,
32+ .detach_client = foo_detach_client,
33+ .command = foo_command, /* may be NULL */
34+ .inc_use = foo_inc_use, /* May be NULL */
35+ .dec_use = foo_dec_use, /* May be NULL */
3636 }
3737
38-The name can be chosen freely, and may be upto 40 characters long. Please
38+The name can be chosen freely, and may be up to 31 characters long. Please
3939 use something descriptive here.
4040
4141 If used, the id should be a unique ID. The range 0xf000 to 0xffff is
@@ -64,26 +64,27 @@ main reason why these call-backs were introduced).
6464 To increase or decrease the module usage count, you can use the
6565 MOD_{INC,DEC}_USE_COUNT macros. They must be called from the module
6666 which needs to get its usage count changed; that is why each driver
67-module has to implement its own callback.
67+module has to implement its own callback functions.
6868
69- void foo_inc_use (struct i2c_client *client)
70- {
71- #ifdef MODULE
72- MOD_INC_USE_COUNT;
73- #endif
74- }
69+static void foo_inc_use (struct i2c_client *client)
70+{
71+#ifdef MODULE
72+ MOD_INC_USE_COUNT;
73+#endif
74+}
7575
76- void foo_dec_use (struct i2c_client *client)
77- {
78- #ifdef MODULE
79- MOD_DEC_USE_COUNT;
80- #endif
81- }
76+static void foo_dec_use (struct i2c_client *client)
77+{
78+#ifdef MODULE
79+ MOD_DEC_USE_COUNT;
80+#endif
81+}
8282
83-Do not call these call-back functions directly; instead, use one of the
83+Do not call these callback functions directly; instead, use the
8484 following functions defined in i2c.h:
85- void i2c_inc_use_client(struct i2c_client *);
86- void i2c_dec_use_client(struct i2c_client *);
85+
86+void i2c_inc_use_client(struct i2c_client *);
87+void i2c_dec_use_client(struct i2c_client *);
8788
8889 You should *not* increase the module count just because a device is
8990 detected and a client created. This would make it impossible to remove
@@ -302,7 +303,7 @@ Also used is a list of pointers to sensors_force_data structures:
302303 These are automatically translated to insmod variables of the form
303304 force_foo.
304305
305-So we have a generic insmod variabled `force', and chip-specific variables
306+So we have a generic insmod variable `force', and chip-specific variables
306307 `force_CHIPNAME'.
307308
308309 Fortunately, as a module writer, you just have to define the `normal'
--- a/drivers/i2c/i2c-algo-bit.c
+++ b/drivers/i2c/i2c-algo-bit.c
@@ -609,8 +609,6 @@ int __init i2c_algo_bit_init (void)
609609 return 0;
610610 }
611611
612-
613-
614612 EXPORT_SYMBOL(i2c_bit_add_bus);
615613 EXPORT_SYMBOL(i2c_bit_del_bus);
616614
--- a/drivers/i2c/i2c-algo-pcf.c
+++ b/drivers/i2c/i2c-algo-pcf.c
@@ -524,7 +524,6 @@ int __init i2c_algo_pcf_init (void)
524524 return 0;
525525 }
526526
527-
528527 EXPORT_SYMBOL(i2c_pcf_add_bus);
529528 EXPORT_SYMBOL(i2c_pcf_del_bus);
530529
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -208,14 +208,14 @@ int i2c_del_adapter(struct i2c_adapter *adap)
208208 if ((res = drivers[j]->attach_adapter(adap))) {
209209 printk(KERN_WARNING "i2c-core.o: can't detach adapter %s "
210210 "while detaching driver %s: driver not "
211- "detached!",adap->name,drivers[j]->name);
211+ "detached!\n", adap->name, drivers[j]->name);
212212 goto ERROR1;
213213 }
214214 DRV_UNLOCK();
215215
216216
217217 /* detach any active clients. This must be done first, because
218- * it can fail; in which case we give upp. */
218+ * it can fail; in which case we give up. */
219219 for (j=0;j<I2C_CLIENT_MAX;j++) {
220220 struct i2c_client *client = adap->clients[j];
221221 if (client!=NULL)
@@ -226,11 +226,12 @@ int i2c_del_adapter(struct i2c_adapter *adap)
226226 if ((res=client->driver->detach_client(client))) {
227227 printk(KERN_ERR "i2c-core.o: adapter %s not "
228228 "unregistered, because client at "
229- "address %02x can't be detached. ",
229+ "address %02x can't be detached\n",
230230 adap->name, client->addr);
231231 goto ERROR0;
232232 }
233233 }
234+
234235 #ifdef CONFIG_PROC_FS
235236 if (i2cproc_initialized) {
236237 char name[8];
@@ -339,7 +340,7 @@ int i2c_del_driver(struct i2c_driver *driver)
339340 printk(KERN_WARNING "i2c-core.o: while unregistering "
340341 "dummy driver %s, adapter %s could "
341342 "not be detached properly; driver "
342- "not unloaded!",driver->name,
343+ "not unloaded!\n", driver->name,
343344 adap->name);
344345 ADAP_UNLOCK();
345346 return res;
@@ -359,9 +360,9 @@ int i2c_del_driver(struct i2c_driver *driver)
359360 "unregistering driver "
360361 "`%s', the client at "
361362 "address %02x of "
362- "adapter `%s' could not"
363- "be detached; driver"
364- "not unloaded!",
363+ "adapter `%s' could not "
364+ "be detached; driver "
365+ "not unloaded!\n",
365366 driver->name,
366367 client->addr,
367368 adap->name);
@@ -448,7 +449,7 @@ int i2c_detach_client(struct i2c_client *client)
448449 if (adapter->client_unregister != NULL)
449450 if ((res = adapter->client_unregister(client))) {
450451 printk(KERN_ERR "i2c-core.o: client_unregister [%s] failed, "
451- "client not detached",client->name);
452+ "client not detached\n", client->name);
452453 return res;
453454 }
454455
@@ -461,20 +462,16 @@ int i2c_detach_client(struct i2c_client *client)
461462
462463 void i2c_inc_use_client(struct i2c_client *client)
463464 {
464-
465465 if (client->driver->inc_use != NULL)
466466 client->driver->inc_use(client);
467-
468467 if (client->adapter->inc_use != NULL)
469468 client->adapter->inc_use(client->adapter);
470469 }
471470
472471 void i2c_dec_use_client(struct i2c_client *client)
473472 {
474-
475473 if (client->driver->dec_use != NULL)
476474 client->driver->dec_use(client);
477-
478475 if (client->adapter->dec_use != NULL)
479476 client->adapter->dec_use(client->adapter);
480477 }
@@ -548,8 +545,8 @@ struct i2c_client *i2c_get_client(int driver_id, int adapter_id,
548545
549546 int i2c_use_client(struct i2c_client *client)
550547 {
551- if(client->flags & I2C_CLIENT_ALLOW_USE) {
552- if (client->flags & I2C_CLIENT_ALLOW_MULTIPLE_USE)
548+ if (client->flags & I2C_CLIENT_ALLOW_USE) {
549+ if (client->flags & I2C_CLIENT_ALLOW_MULTIPLE_USE)
553550 client->usage_count++;
554551 else {
555552 if(client->usage_count > 0)
@@ -712,7 +709,6 @@ int i2cproc_cleanup(void)
712709 return 0;
713710 }
714711
715-
716712 #endif /* def CONFIG_PROC_FS */
717713
718714 /* ----------------------------------------------------
@@ -984,7 +980,7 @@ extern s32 i2c_smbus_read_byte(struct i2c_client * client)
984980 extern s32 i2c_smbus_write_byte(struct i2c_client * client, u8 value)
985981 {
986982 return i2c_smbus_xfer(client->adapter,client->addr,client->flags,
987- I2C_SMBUS_WRITE,value, I2C_SMBUS_BYTE,NULL);
983+ I2C_SMBUS_WRITE, value, I2C_SMBUS_BYTE, NULL);
988984 }
989985
990986 extern s32 i2c_smbus_read_byte_data(struct i2c_client * client, u8 command)
@@ -1193,7 +1189,9 @@ s32 i2c_smbus_xfer(struct i2c_adapter * adapter, u16 addr, unsigned short flags,
11931189 union i2c_smbus_data * data)
11941190 {
11951191 s32 res;
1192+
11961193 flags = flags & I2C_M_TEN;
1194+
11971195 if (adapter->algo->smbus_xfer) {
11981196 I2C_LOCK(adapter);
11991197 res = adapter->algo->smbus_xfer(adapter,addr,flags,read_write,
@@ -1202,6 +1200,7 @@ s32 i2c_smbus_xfer(struct i2c_adapter * adapter, u16 addr, unsigned short flags,
12021200 } else
12031201 res = i2c_smbus_xfer_emulated(adapter,addr,flags,read_write,
12041202 command,size,data);
1203+
12051204 return res;
12061205 }
12071206
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -39,16 +39,14 @@
3939 #ifdef CONFIG_DEVFS_FS
4040 #include <linux/devfs_fs_kernel.h>
4141 #endif
42-
42+#include <linux/init.h>
43+#include <linux/i2c.h>
44+#include <linux/i2c-dev.h>
45+#include <asm/uaccess.h>
4346
4447 /* If you want debugging uncomment: */
4548 /* #define DEBUG */
4649
47-#include <linux/init.h>
48-#include <asm/uaccess.h>
49-
50-#include <linux/i2c.h>
51-#include <linux/i2c-dev.h>
5250
5351 #ifdef MODULE
5452 extern int init_module(void);
@@ -229,7 +227,7 @@ int i2cdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
229227 sizeof(rdwr_arg)))
230228 return -EFAULT;
231229
232- /* Put an arbritrary limit on the number of messages that can
230+ /* Put an arbitrary limit on the number of messages that can
233231 * be sent at once */
234232 if (rdwr_arg.nmsgs > 42)
235233 return -EINVAL;
--- a/drivers/i2c/i2c-elv.c
+++ b/drivers/i2c/i2c-elv.c
@@ -28,14 +28,11 @@
2828 #include <linux/delay.h>
2929 #include <linux/slab.h>
3030 #include <linux/init.h>
31-
32-#include <asm/uaccess.h>
33-
3431 #include <linux/ioport.h>
35-#include <asm/io.h>
3632 #include <linux/errno.h>
3733 #include <linux/i2c.h>
3834 #include <linux/i2c-algo-bit.h>
35+#include <asm/io.h>
3936
4037 #define DEFAULT_BASE 0x378
4138 static int base=0;
--- a/drivers/i2c/i2c-proc.c
+++ b/drivers/i2c/i2c-proc.c
@@ -29,13 +29,11 @@
2929 #include <linux/ctype.h>
3030 #include <linux/sysctl.h>
3131 #include <linux/proc_fs.h>
32+#include <linux/init.h>
3233 #include <linux/ioport.h>
33-#include <asm/uaccess.h>
34-
3534 #include <linux/i2c.h>
3635 #include <linux/i2c-proc.h>
37-
38-#include <linux/init.h>
36+#include <asm/uaccess.h>
3937
4038 #ifndef THIS_MODULE
4139 #define THIS_MODULE NULL
@@ -126,11 +124,9 @@ int i2c_create_name(char **name, const char *prefix,
126124 If any driver wants subdirectories within the newly created directory,
127125 this function must be updated!
128126 controlling_mod is the controlling module. It should usually be
129- THIS_MODULE when calling. Note that this symbol is not defined in
130- kernels before 2.3.13; define it to NULL in that case. We will not use it
131- for anything older than 2.3.27 anyway. */
127+ THIS_MODULE when calling. */
132128 int i2c_register_entry(struct i2c_client *client, const char *prefix,
133- ctl_table * ctl_template,
129+ ctl_table *ctl_template,
134130 struct module *controlling_mod)
135131 {
136132 int i, res, len, id;
--- a/drivers/i2c/i2c-velleman.c
+++ b/drivers/i2c/i2c-velleman.c
@@ -24,12 +24,12 @@
2424 #include <linux/ioport.h>
2525 #include <linux/module.h>
2626 #include <linux/init.h>
27-#include <linux/string.h> /* for 2.0 kernels to get NULL */
28-#include <asm/errno.h> /* for 2.0 kernels to get ENODEV */
29-#include <asm/io.h>
30-
27+#include <linux/errno.h>
28+#include <linux/delay.h>
3129 #include <linux/i2c.h>
3230 #include <linux/i2c-algo-bit.h>
31+#include <asm/io.h>
32+#include <asm/param.h> /* for HZ */
3333
3434 /* ----- global defines ----------------------------------------------- */
3535 #define DEB(x) /* should be reasonable open, close &c. */
--- a/include/linux/i2c-algo-bit.h
+++ b/include/linux/i2c-algo-bit.h
@@ -42,9 +42,10 @@ struct i2c_algo_bit_data {
4242 int (*getscl) (void *data);
4343
4444 /* local settings */
45- int udelay;
46- int mdelay;
47- int timeout;
45+ int udelay; /* half-clock-cycle time in microsecs */
46+ /* i.e. clock is (500 / udelay) KHz */
47+ int mdelay; /* in millisecs, unused */
48+ int timeout; /* in jiffies */
4849 };
4950
5051 #define I2C_BIT_ADAP_MAX 16
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -91,9 +91,9 @@
9191 #define I2C_DRIVERID_SP5055 44 /* Satellite tuner */
9292 #define I2C_DRIVERID_STV0030 45 /* Multipurpose switch */
9393 #define I2C_DRIVERID_ADV7175 48 /* ADV 7175/7176 video encoder */
94-#define I2C_DRIVERID_MAX1617 56 /* temp sensor */
95-#define I2C_DRIVERID_SAA7191 57 /* video decoder */
96-#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */
94+#define I2C_DRIVERID_MAX1617 56 /* temp sensor */
95+#define I2C_DRIVERID_SAA7191 57 /* video decoder */
96+#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */
9797
9898 #define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */
9999 #define I2C_DRIVERID_EXP1 0xF1
--- a/include/linux/i2c-proc.h
+++ b/include/linux/i2c-proc.h
@@ -1,6 +1,7 @@
11 /*
2- sensors.h - Part of lm_sensors, Linux kernel modules for hardware
3- monitoring
2+ i2c-proc.h - Part of the i2c package
3+ was originally sensors.h - Part of lm_sensors, Linux kernel modules
4+ for hardware monitoring
45 Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>
56
67 This program is free software; you can redistribute it and/or modify
@@ -23,9 +24,6 @@
2324
2425 #ifdef __KERNEL__
2526
26-/* Next two must be included before sysctl.h can be included, in 2.0 kernels */
27-#include <linux/types.h>
28-#include <linux/fs.h>
2927 #include <linux/sysctl.h>
3028
3129 /* The type of callback functions used in sensors_{proc,sysctl}_real */
@@ -362,7 +360,7 @@ extern int i2c_detect(struct i2c_adapter *adapter,
362360
363361 /* This macro is used to scale user-input to sensible values in almost all
364362 chip drivers. */
365-extern inline int SENSORS_LIMIT(long value, long low, long high)
363+static inline int SENSORS_LIMIT(long value, long low, long high)
366364 {
367365 if (value < low)
368366 return low;
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -139,14 +139,14 @@ struct i2c_driver {
139139 */
140140 int (*command)(struct i2c_client *client,unsigned int cmd, void *arg);
141141
142- /* These two are mainly used for bookkeeping & dynamic unloading of
142+ /* These two are used for bookkeeping & dynamic unloading of
143143 * kernel modules. inc_use tells the driver that a client is being
144144 * used by another module & that it should increase its ref. counter.
145145 * dec_use is the inverse operation.
146146 * NB: Make sure you have no circular dependencies, or else you get a
147147 * deadlock when trying to unload the modules.
148- * You should use the i2c_{inc,dec}_use_client functions instead of
149- * calling this function directly.
148+ * You should use the i2c_{inc,dec}_use_client functions instead of
149+ * calling this function directly.
150150 */
151151 void (*inc_use)(struct i2c_client *client);
152152 void (*dec_use)(struct i2c_client *client);
旧リポジトリブラウザで表示