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
nexedi
linux
Commits
71bcb29d
Commit
71bcb29d
authored
Mar 20, 2003
by
Greg Kroah-Hartman
Committed by
Petr Vandrovec
Mar 20, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] i2c: remove *data from i2c_adapter, as dev->data should be used instead.
parent
50fb80a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
drivers/i2c/i2c-elv.c
drivers/i2c/i2c-elv.c
+1
-1
drivers/i2c/scx200_acb.c
drivers/i2c/scx200_acb.c
+2
-2
include/linux/i2c.h
include/linux/i2c.h
+11
-6
No files found.
drivers/i2c/i2c-elv.c
View file @
71bcb29d
...
@@ -150,7 +150,7 @@ static int __init i2c_bitelv_init(void)
...
@@ -150,7 +150,7 @@ static int __init i2c_bitelv_init(void)
return
-
ENODEV
;
return
-
ENODEV
;
}
}
}
else
{
}
else
{
bit_elv_ops
.
data
=
(
void
*
)
base
;
i2c_set_adapdata
(
&
bit_elv_ops
,
(
void
*
)
base
)
;
if
(
bit_elv_init
()
==
0
)
{
if
(
bit_elv_init
()
==
0
)
{
if
(
i2c_bit_add_bus
(
&
bit_elv_ops
)
<
0
)
if
(
i2c_bit_add_bus
(
&
bit_elv_ops
)
<
0
)
return
-
ENODEV
;
return
-
ENODEV
;
...
...
drivers/i2c/scx200_acb.c
View file @
71bcb29d
...
@@ -289,7 +289,7 @@ static s32 scx200_acb_smbus_xfer(struct i2c_adapter *adapter,
...
@@ -289,7 +289,7 @@ static s32 scx200_acb_smbus_xfer(struct i2c_adapter *adapter,
char
rw
,
u8
command
,
int
size
,
char
rw
,
u8
command
,
int
size
,
union
i2c_smbus_data
*
data
)
union
i2c_smbus_data
*
data
)
{
{
struct
scx200_acb_iface
*
iface
=
adapter
->
data
;
struct
scx200_acb_iface
*
iface
=
i2c_get_adapdata
(
adapter
)
;
int
len
;
int
len
;
u8
*
buffer
;
u8
*
buffer
;
u16
cur_word
;
u16
cur_word
;
...
@@ -455,7 +455,7 @@ static int __init scx200_acb_create(int base, int index)
...
@@ -455,7 +455,7 @@ static int __init scx200_acb_create(int base, int index)
memset
(
iface
,
0
,
sizeof
(
*
iface
));
memset
(
iface
,
0
,
sizeof
(
*
iface
));
adapter
=
&
iface
->
adapter
;
adapter
=
&
iface
->
adapter
;
adapter
->
data
=
iface
;
i2c_set_adapdata
(
adapter
,
iface
)
;
snprintf
(
adapter
->
dev
.
name
,
DEVICE_NAME_SIZE
,
"SCx200 ACB%d"
,
index
);
snprintf
(
adapter
->
dev
.
name
,
DEVICE_NAME_SIZE
,
"SCx200 ACB%d"
,
index
);
adapter
->
owner
=
THIS_MODULE
;
adapter
->
owner
=
THIS_MODULE
;
adapter
->
id
=
I2C_ALGO_SMBUS
;
adapter
->
id
=
I2C_ALGO_SMBUS
;
...
...
include/linux/i2c.h
View file @
71bcb29d
...
@@ -219,12 +219,7 @@ struct i2c_adapter {
...
@@ -219,12 +219,7 @@ struct i2c_adapter {
int
(
*
client_register
)(
struct
i2c_client
*
);
int
(
*
client_register
)(
struct
i2c_client
*
);
int
(
*
client_unregister
)(
struct
i2c_client
*
);
int
(
*
client_unregister
)(
struct
i2c_client
*
);
void
*
data
;
/* private data for the adapter */
/* data fields that are valid for all devices */
/* some data fields that are used by all types */
/* these data fields are readonly to the public */
/* and can be set via the i2c_ioctl call */
/* data fields that are valid for all devices */
struct
semaphore
bus
;
struct
semaphore
bus
;
struct
semaphore
list
;
struct
semaphore
list
;
unsigned
int
flags
;
/* flags specifying div. data */
unsigned
int
flags
;
/* flags specifying div. data */
...
@@ -242,6 +237,16 @@ struct i2c_adapter {
...
@@ -242,6 +237,16 @@ struct i2c_adapter {
};
};
#define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev)
#define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev)
static
inline
void
*
i2c_get_adapdata
(
struct
i2c_adapter
*
dev
)
{
return
dev_get_drvdata
(
&
dev
->
dev
);
}
static
inline
void
i2c_set_adapdata
(
struct
i2c_adapter
*
dev
,
void
*
data
)
{
return
dev_set_drvdata
(
&
dev
->
dev
,
data
);
}
/*flags for the driver struct: */
/*flags for the driver struct: */
#define I2C_DF_NOTIFY 0x01
/* notify on bus (de/a)ttaches */
#define I2C_DF_NOTIFY 0x01
/* notify on bus (de/a)ttaches */
#define I2C_DF_DUMMY 0x02
/* do not connect any clients */
#define I2C_DF_DUMMY 0x02
/* do not connect any clients */
...
...
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