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
3d9efaae
Commit
3d9efaae
authored
Aug 30, 2014
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
greybus: i2c: use same naming convention everywhere
parent
e7e0782c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
drivers/staging/greybus/i2c-gb.c
drivers/staging/greybus/i2c-gb.c
+17
-17
No files found.
drivers/staging/greybus/i2c-gb.c
View file @
3d9efaae
...
@@ -32,11 +32,11 @@ static s32 i2c_gb_access(struct i2c_adapter *adap, u16 addr,
...
@@ -32,11 +32,11 @@ static s32 i2c_gb_access(struct i2c_adapter *adap, u16 addr,
unsigned
short
flags
,
char
read_write
,
u8
command
,
unsigned
short
flags
,
char
read_write
,
u8
command
,
int
size
,
union
i2c_smbus_data
*
data
)
int
size
,
union
i2c_smbus_data
*
data
)
{
{
struct
gb_i2c_device
*
i2c_gb
_dev
;
struct
gb_i2c_device
*
gb_i2c
_dev
;
struct
greybus_device
*
gdev
;
struct
greybus_device
*
gdev
;
i2c_gb
_dev
=
i2c_get_adapdata
(
adap
);
gb_i2c
_dev
=
i2c_get_adapdata
(
adap
);
gdev
=
i2c_gb
_dev
->
gdev
;
gdev
=
gb_i2c
_dev
->
gdev
;
// FIXME - do the actual work of sending a i2c message here...
// FIXME - do the actual work of sending a i2c message here...
switch
(
size
)
{
switch
(
size
)
{
...
@@ -78,20 +78,20 @@ static const struct i2c_algorithm smbus_algorithm = {
...
@@ -78,20 +78,20 @@ static const struct i2c_algorithm smbus_algorithm = {
int
gb_i2c_probe
(
struct
greybus_device
*
gdev
,
int
gb_i2c_probe
(
struct
greybus_device
*
gdev
,
const
struct
greybus_device_id
*
id
)
const
struct
greybus_device_id
*
id
)
{
{
struct
gb_i2c_device
*
i2c_gb
_dev
;
struct
gb_i2c_device
*
gb_i2c
_dev
;
struct
i2c_adapter
*
adapter
;
struct
i2c_adapter
*
adapter
;
int
retval
;
int
retval
;
i2c_gb_dev
=
kzalloc
(
sizeof
(
*
i2c_gb
_dev
),
GFP_KERNEL
);
gb_i2c_dev
=
kzalloc
(
sizeof
(
*
gb_i2c
_dev
),
GFP_KERNEL
);
if
(
!
i2c_gb
_dev
)
if
(
!
gb_i2c
_dev
)
return
-
ENOMEM
;
return
-
ENOMEM
;
adapter
=
kzalloc
(
sizeof
(
*
adapter
),
GFP_KERNEL
);
adapter
=
kzalloc
(
sizeof
(
*
adapter
),
GFP_KERNEL
);
if
(
!
adapter
)
{
if
(
!
adapter
)
{
kfree
(
i2c_gb
_dev
);
kfree
(
gb_i2c
_dev
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
i2c_set_adapdata
(
adapter
,
i2c_gb
_dev
);
i2c_set_adapdata
(
adapter
,
gb_i2c
_dev
);
adapter
->
owner
=
THIS_MODULE
;
adapter
->
owner
=
THIS_MODULE
;
adapter
->
class
=
I2C_CLASS_HWMON
|
I2C_CLASS_SPD
;
adapter
->
class
=
I2C_CLASS_HWMON
|
I2C_CLASS_SPD
;
adapter
->
algo
=
&
smbus_algorithm
;
adapter
->
algo
=
&
smbus_algorithm
;
...
@@ -104,25 +104,25 @@ int gb_i2c_probe(struct greybus_device *gdev,
...
@@ -104,25 +104,25 @@ int gb_i2c_probe(struct greybus_device *gdev,
goto
error
;
goto
error
;
}
}
i2c_gb
_dev
->
gdev
=
gdev
;
gb_i2c
_dev
->
gdev
=
gdev
;
i2c_gb
_dev
->
adapter
=
adapter
;
gb_i2c
_dev
->
adapter
=
adapter
;
gdev
->
gb_i2c_dev
=
i2c_gb
_dev
;
gdev
->
gb_i2c_dev
=
gb_i2c
_dev
;
return
0
;
return
0
;
error:
error:
kfree
(
adapter
);
kfree
(
adapter
);
kfree
(
i2c_gb
_dev
);
kfree
(
gb_i2c
_dev
);
return
retval
;
return
retval
;
}
}
void
gb_i2c_disconnect
(
struct
greybus_device
*
gdev
)
void
gb_i2c_disconnect
(
struct
greybus_device
*
gdev
)
{
{
struct
gb_i2c_device
*
i2c_gb
_dev
;
struct
gb_i2c_device
*
gb_i2c
_dev
;
i2c_gb
_dev
=
gdev
->
gb_i2c_dev
;
gb_i2c
_dev
=
gdev
->
gb_i2c_dev
;
i2c_del_adapter
(
i2c_gb
_dev
->
adapter
);
i2c_del_adapter
(
gb_i2c
_dev
->
adapter
);
kfree
(
i2c_gb
_dev
->
adapter
);
kfree
(
gb_i2c
_dev
->
adapter
);
kfree
(
i2c_gb
_dev
);
kfree
(
gb_i2c
_dev
);
}
}
#if 0
#if 0
...
...
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