Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
2cdddeb8
Commit
2cdddeb8
authored
Jan 27, 2008
by
Jean Delvare
Committed by
Jean Delvare
Jan 27, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i2c: normal_i2c can be made const (remaining drivers)
Signed-off-by:
Jean Delvare
<
khali@linux-fr.org
>
parent
922539a0
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
20 additions
and
18 deletions
+20
-18
Documentation/i2c/writing-clients
Documentation/i2c/writing-clients
+3
-3
arch/arm/mach-pxa/akita-ioexp.c
arch/arm/mach-pxa/akita-ioexp.c
+1
-1
drivers/i2c/chips/eeprom.c
drivers/i2c/chips/eeprom.c
+1
-1
drivers/i2c/chips/max6875.c
drivers/i2c/chips/max6875.c
+1
-1
drivers/i2c/chips/pcf8574.c
drivers/i2c/chips/pcf8574.c
+5
-3
drivers/i2c/chips/pcf8575.c
drivers/i2c/chips/pcf8575.c
+1
-1
drivers/i2c/chips/pcf8591.c
drivers/i2c/chips/pcf8591.c
+1
-1
drivers/macintosh/therm_windtunnel.c
drivers/macintosh/therm_windtunnel.c
+1
-1
drivers/usb/host/ohci-pnx4008.c
drivers/usb/host/ohci-pnx4008.c
+2
-2
drivers/video/matrox/matroxfb_maven.c
drivers/video/matrox/matroxfb_maven.c
+1
-1
drivers/w1/masters/ds2482.c
drivers/w1/masters/ds2482.c
+1
-1
sound/soc/codecs/cs4270.c
sound/soc/codecs/cs4270.c
+1
-1
sound/soc/s3c24xx/neo1973_wm8753.c
sound/soc/s3c24xx/neo1973_wm8753.c
+1
-1
No files found.
Documentation/i2c/writing-clients
View file @
2cdddeb8
...
@@ -267,9 +267,9 @@ insmod parameter of the form force_<kind>.
...
@@ -267,9 +267,9 @@ insmod parameter of the form force_<kind>.
Fortunately, as a module writer, you just have to define the `normal_i2c'
Fortunately, as a module writer, you just have to define the `normal_i2c'
parameter. The complete declaration could look like this:
parameter. The complete declaration could look like this:
/* Scan 0x
37, and 0x48
to 0x4f */
/* Scan 0x
4c
to 0x4f */
static
unsigned short normal_i2c[] = { 0x37, 0x48, 0x49, 0x4a, 0x4b, 0x4c
,
static
const unsigned short normal_i2c[] = { 0x4c, 0x4d, 0x4e, 0x4f
,
0x4d, 0x4e, 0x4f,
I2C_CLIENT_END };
I2C_CLIENT_END };
/* Magic definition of all other variables and things */
/* Magic definition of all other variables and things */
I2C_CLIENT_INSMOD;
I2C_CLIENT_INSMOD;
...
...
arch/arm/mach-pxa/akita-ioexp.c
View file @
2cdddeb8
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
#define MAX7310_TIMEOUT 0x04
#define MAX7310_TIMEOUT 0x04
/* Addresses to scan */
/* Addresses to scan */
static
unsigned
short
normal_i2c
[]
=
{
0x18
,
I2C_CLIENT_END
};
static
const
unsigned
short
normal_i2c
[]
=
{
0x18
,
I2C_CLIENT_END
};
/* I2C Magic */
/* I2C Magic */
I2C_CLIENT_INSMOD
;
I2C_CLIENT_INSMOD
;
...
...
drivers/i2c/chips/eeprom.c
View file @
2cdddeb8
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
#include <linux/mutex.h>
#include <linux/mutex.h>
/* Addresses to scan */
/* Addresses to scan */
static
unsigned
short
normal_i2c
[]
=
{
0x50
,
0x51
,
0x52
,
0x53
,
0x54
,
static
const
unsigned
short
normal_i2c
[]
=
{
0x50
,
0x51
,
0x52
,
0x53
,
0x54
,
0x55
,
0x56
,
0x57
,
I2C_CLIENT_END
};
0x55
,
0x56
,
0x57
,
I2C_CLIENT_END
};
/* Insmod parameters */
/* Insmod parameters */
...
...
drivers/i2c/chips/max6875.c
View file @
2cdddeb8
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
#include <linux/mutex.h>
#include <linux/mutex.h>
/* Do not scan - the MAX6875 access method will write to some EEPROM chips */
/* Do not scan - the MAX6875 access method will write to some EEPROM chips */
static
unsigned
short
normal_i2c
[]
=
{
I2C_CLIENT_END
};
static
const
unsigned
short
normal_i2c
[]
=
{
I2C_CLIENT_END
};
/* Insmod parameters */
/* Insmod parameters */
I2C_CLIENT_INSMOD_1
(
max6875
);
I2C_CLIENT_INSMOD_1
(
max6875
);
...
...
drivers/i2c/chips/pcf8574.c
View file @
2cdddeb8
...
@@ -41,9 +41,11 @@
...
@@ -41,9 +41,11 @@
#include <linux/i2c.h>
#include <linux/i2c.h>
/* Addresses to scan */
/* Addresses to scan */
static
unsigned
short
normal_i2c
[]
=
{
0x20
,
0x21
,
0x22
,
0x23
,
0x24
,
0x25
,
0x26
,
0x27
,
static
const
unsigned
short
normal_i2c
[]
=
{
0x20
,
0x21
,
0x22
,
0x23
,
0x24
,
0x25
,
0x26
,
0x27
,
0x38
,
0x39
,
0x3a
,
0x3b
,
0x3c
,
0x3d
,
0x3e
,
0x3f
,
0x38
,
0x39
,
0x3a
,
0x3b
,
0x3c
,
0x3d
,
0x3e
,
0x3f
,
I2C_CLIENT_END
};
I2C_CLIENT_END
};
/* Insmod parameters */
/* Insmod parameters */
I2C_CLIENT_INSMOD_2
(
pcf8574
,
pcf8574a
);
I2C_CLIENT_INSMOD_2
(
pcf8574
,
pcf8574a
);
...
...
drivers/i2c/chips/pcf8575.c
View file @
2cdddeb8
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
#include <linux/sysfs.h>
/* sysfs_create_group() */
#include <linux/sysfs.h>
/* sysfs_create_group() */
/* Addresses to scan */
/* Addresses to scan */
static
unsigned
short
normal_i2c
[]
=
{
static
const
unsigned
short
normal_i2c
[]
=
{
0x20
,
0x21
,
0x22
,
0x23
,
0x24
,
0x25
,
0x26
,
0x27
,
0x20
,
0x21
,
0x22
,
0x23
,
0x24
,
0x25
,
0x26
,
0x27
,
I2C_CLIENT_END
I2C_CLIENT_END
};
};
...
...
drivers/i2c/chips/pcf8591.c
View file @
2cdddeb8
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#include <linux/mutex.h>
#include <linux/mutex.h>
/* Addresses to scan */
/* Addresses to scan */
static
unsigned
short
normal_i2c
[]
=
{
0x48
,
0x49
,
0x4a
,
0x4b
,
0x4c
,
static
const
unsigned
short
normal_i2c
[]
=
{
0x48
,
0x49
,
0x4a
,
0x4b
,
0x4c
,
0x4d
,
0x4e
,
0x4f
,
I2C_CLIENT_END
};
0x4d
,
0x4e
,
0x4f
,
I2C_CLIENT_END
};
/* Insmod parameters */
/* Insmod parameters */
...
...
drivers/macintosh/therm_windtunnel.c
View file @
2cdddeb8
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
static
int
do_probe
(
struct
i2c_adapter
*
adapter
,
int
addr
,
int
kind
);
static
int
do_probe
(
struct
i2c_adapter
*
adapter
,
int
addr
,
int
kind
);
/* scan 0x48-0x4f (DS1775) and 0x2c-2x2f (ADM1030) */
/* scan 0x48-0x4f (DS1775) and 0x2c-2x2f (ADM1030) */
static
unsigned
short
normal_i2c
[]
=
{
0x48
,
0x49
,
0x4a
,
0x4b
,
static
const
unsigned
short
normal_i2c
[]
=
{
0x48
,
0x49
,
0x4a
,
0x4b
,
0x4c
,
0x4d
,
0x4e
,
0x4f
,
0x4c
,
0x4d
,
0x4e
,
0x4f
,
0x2c
,
0x2d
,
0x2e
,
0x2f
,
0x2c
,
0x2d
,
0x2e
,
0x2f
,
I2C_CLIENT_END
};
I2C_CLIENT_END
};
...
...
drivers/usb/host/ohci-pnx4008.c
View file @
2cdddeb8
...
@@ -112,9 +112,9 @@ static int isp1301_detach(struct i2c_client *client);
...
@@ -112,9 +112,9 @@ static int isp1301_detach(struct i2c_client *client);
static
int
isp1301_command
(
struct
i2c_client
*
client
,
unsigned
int
cmd
,
static
int
isp1301_command
(
struct
i2c_client
*
client
,
unsigned
int
cmd
,
void
*
arg
);
void
*
arg
);
static
unsigned
short
normal_i2c
[]
=
static
const
unsigned
short
normal_i2c
[]
=
{
ISP1301_I2C_ADDR
,
ISP1301_I2C_ADDR
+
1
,
I2C_CLIENT_END
};
{
ISP1301_I2C_ADDR
,
ISP1301_I2C_ADDR
+
1
,
I2C_CLIENT_END
};
static
unsigned
short
dummy_i2c_addrlist
[]
=
{
I2C_CLIENT_END
};
static
const
unsigned
short
dummy_i2c_addrlist
[]
=
{
I2C_CLIENT_END
};
static
struct
i2c_client_address_data
addr_data
=
{
static
struct
i2c_client_address_data
addr_data
=
{
.
normal_i2c
=
normal_i2c
,
.
normal_i2c
=
normal_i2c
,
...
...
drivers/video/matrox/matroxfb_maven.c
View file @
2cdddeb8
...
@@ -1232,7 +1232,7 @@ static int maven_shutdown_client(struct i2c_client* clnt) {
...
@@ -1232,7 +1232,7 @@ static int maven_shutdown_client(struct i2c_client* clnt) {
return
0
;
return
0
;
}
}
static
unsigned
short
normal_i2c
[]
=
{
MAVEN_I2CID
,
I2C_CLIENT_END
};
static
const
unsigned
short
normal_i2c
[]
=
{
MAVEN_I2CID
,
I2C_CLIENT_END
};
I2C_CLIENT_INSMOD
;
I2C_CLIENT_INSMOD
;
static
struct
i2c_driver
maven_driver
;
static
struct
i2c_driver
maven_driver
;
...
...
drivers/w1/masters/ds2482.c
View file @
2cdddeb8
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
* However, the chip cannot be detected without doing an i2c write,
* However, the chip cannot be detected without doing an i2c write,
* so use the force module parameter.
* so use the force module parameter.
*/
*/
static
unsigned
short
normal_i2c
[]
=
{
I2C_CLIENT_END
};
static
const
unsigned
short
normal_i2c
[]
=
{
I2C_CLIENT_END
};
/**
/**
* Insmod parameters
* Insmod parameters
...
...
sound/soc/codecs/cs4270.c
View file @
2cdddeb8
...
@@ -234,7 +234,7 @@ static int cs4270_set_dai_fmt(struct snd_soc_codec_dai *codec_dai,
...
@@ -234,7 +234,7 @@ static int cs4270_set_dai_fmt(struct snd_soc_codec_dai *codec_dai,
* lower three bits are determined via the AD2, AD1, and AD0 pins
* lower three bits are determined via the AD2, AD1, and AD0 pins
* (respectively).
* (respectively).
*/
*/
static
unsigned
short
normal_i2c
[]
=
{
static
const
unsigned
short
normal_i2c
[]
=
{
0x48
,
0x49
,
0x4A
,
0x4B
,
0x4C
,
0x4D
,
0x4E
,
0x4F
,
I2C_CLIENT_END
0x48
,
0x49
,
0x4A
,
0x4B
,
0x4C
,
0x4D
,
0x4E
,
0x4F
,
I2C_CLIENT_END
};
};
I2C_CLIENT_INSMOD
;
I2C_CLIENT_INSMOD
;
...
...
sound/soc/s3c24xx/neo1973_wm8753.c
View file @
2cdddeb8
...
@@ -573,7 +573,7 @@ static struct snd_soc_device neo1973_snd_devdata = {
...
@@ -573,7 +573,7 @@ static struct snd_soc_device neo1973_snd_devdata = {
static
struct
i2c_client
client_template
;
static
struct
i2c_client
client_template
;
static
unsigned
short
normal_i2c
[]
=
{
0x7C
,
I2C_CLIENT_END
};
static
const
unsigned
short
normal_i2c
[]
=
{
0x7C
,
I2C_CLIENT_END
};
/* Magic definition of all other variables and things */
/* Magic definition of all other variables and things */
I2C_CLIENT_INSMOD
;
I2C_CLIENT_INSMOD
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment