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
392e687b
Commit
392e687b
authored
May 09, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] i2c: register the i2c_adapter_driver so things link up properly in sysfs
parent
0d08e838
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
drivers/i2c/i2c-core.c
drivers/i2c/i2c-core.c
+7
-3
No files found.
drivers/i2c/i2c-core.c
View file @
392e687b
...
@@ -55,8 +55,8 @@ int i2c_device_remove(struct device *dev)
...
@@ -55,8 +55,8 @@ int i2c_device_remove(struct device *dev)
return
0
;
return
0
;
}
}
static
struct
device_driver
i2c_
generic
_driver
=
{
static
struct
device_driver
i2c_
adapter
_driver
=
{
.
name
=
"i2c"
,
.
name
=
"i2c
_adapter
"
,
.
bus
=
&
i2c_bus_type
,
.
bus
=
&
i2c_bus_type
,
.
probe
=
i2c_device_probe
,
.
probe
=
i2c_device_probe
,
.
remove
=
i2c_device_remove
,
.
remove
=
i2c_device_remove
,
...
@@ -98,7 +98,7 @@ int i2c_add_adapter(struct i2c_adapter *adap)
...
@@ -98,7 +98,7 @@ int i2c_add_adapter(struct i2c_adapter *adap)
if
(
adap
->
dev
.
parent
==
NULL
)
if
(
adap
->
dev
.
parent
==
NULL
)
adap
->
dev
.
parent
=
&
legacy_bus
;
adap
->
dev
.
parent
=
&
legacy_bus
;
sprintf
(
adap
->
dev
.
bus_id
,
"i2c-%d"
,
adap
->
nr
);
sprintf
(
adap
->
dev
.
bus_id
,
"i2c-%d"
,
adap
->
nr
);
adap
->
dev
.
driver
=
&
i2c_
generic
_driver
;
adap
->
dev
.
driver
=
&
i2c_
adapter
_driver
;
device_register
(
&
adap
->
dev
);
device_register
(
&
adap
->
dev
);
/* Add this adapter to the i2c_adapter class */
/* Add this adapter to the i2c_adapter class */
...
@@ -460,6 +460,9 @@ static int __init i2c_init(void)
...
@@ -460,6 +460,9 @@ static int __init i2c_init(void)
int
retval
;
int
retval
;
retval
=
bus_register
(
&
i2c_bus_type
);
retval
=
bus_register
(
&
i2c_bus_type
);
if
(
retval
)
return
retval
;
retval
=
driver_register
(
&
i2c_adapter_driver
);
if
(
retval
)
if
(
retval
)
return
retval
;
return
retval
;
return
class_register
(
&
i2c_adapter_class
);
return
class_register
(
&
i2c_adapter_class
);
...
@@ -468,6 +471,7 @@ static int __init i2c_init(void)
...
@@ -468,6 +471,7 @@ static int __init i2c_init(void)
static
void
__exit
i2c_exit
(
void
)
static
void
__exit
i2c_exit
(
void
)
{
{
class_unregister
(
&
i2c_adapter_class
);
class_unregister
(
&
i2c_adapter_class
);
driver_unregister
(
&
i2c_adapter_driver
);
bus_unregister
(
&
i2c_bus_type
);
bus_unregister
(
&
i2c_bus_type
);
}
}
...
...
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