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
53419e07
Commit
53419e07
authored
Aug 11, 2014
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
greybus: i2c-gb: actually add the i2c adapter properly...
parent
4c009fad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
drivers/staging/greybus/i2c-gb.c
drivers/staging/greybus/i2c-gb.c
+13
-0
No files found.
drivers/staging/greybus/i2c-gb.c
View file @
53419e07
...
...
@@ -79,6 +79,7 @@ static int i2c_gb_probe(struct greybus_device *gdev, const struct greybus_device
{
struct
i2c_gb_data
*
i2c_gb_data
;
struct
i2c_adapter
*
adapter
;
int
retval
;
i2c_gb_data
=
kzalloc
(
sizeof
(
*
i2c_gb_data
),
GFP_KERNEL
);
if
(
!
i2c_gb_data
)
...
...
@@ -93,12 +94,24 @@ static int i2c_gb_probe(struct greybus_device *gdev, const struct greybus_device
adapter
->
owner
=
THIS_MODULE
;
adapter
->
class
=
I2C_CLASS_HWMON
|
I2C_CLASS_SPD
;
adapter
->
algo
=
&
smbus_algorithm
;
adapter
->
dev
.
parent
=
&
gdev
->
dev
;
adapter
->
retries
=
3
;
/* we have to pick something... */
snprintf
(
adapter
->
name
,
sizeof
(
adapter
->
name
),
"Greybus i2c adapter"
);
retval
=
i2c_add_adapter
(
adapter
);
if
(
retval
)
{
dev_err
(
&
gdev
->
dev
,
"Can not add SMBus adapter
\n
"
);
goto
error
;
}
i2c_gb_data
->
gdev
=
gdev
;
i2c_gb_data
->
adapter
=
adapter
;
greybus_set_drvdata
(
gdev
,
i2c_gb_data
);
return
0
;
error:
kfree
(
adapter
);
kfree
(
i2c_gb_data
);
return
retval
;
}
static
void
i2c_gb_disconnect
(
struct
greybus_device
*
gdev
)
...
...
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