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
afe90203
Commit
afe90203
authored
Jan 07, 2015
by
Wolfram Sang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i2c: dln2: make use of the new infrastructure for quirks
Signed-off-by:
Wolfram Sang
<
wsa@the-dreams.de
>
parent
280d2300
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
drivers/i2c/busses/i2c-dln2.c
drivers/i2c/busses/i2c-dln2.c
+6
-6
No files found.
drivers/i2c/busses/i2c-dln2.c
View file @
afe90203
...
...
@@ -144,7 +144,6 @@ static int dln2_i2c_xfer(struct i2c_adapter *adapter,
{
struct
dln2_i2c
*
dln2
=
i2c_get_adapdata
(
adapter
);
struct
i2c_msg
*
pmsg
;
struct
device
*
dev
=
&
dln2
->
adapter
.
dev
;
int
i
;
for
(
i
=
0
;
i
<
num
;
i
++
)
{
...
...
@@ -152,11 +151,6 @@ static int dln2_i2c_xfer(struct i2c_adapter *adapter,
pmsg
=
&
msgs
[
i
];
if
(
pmsg
->
len
>
DLN2_I2C_MAX_XFER_SIZE
)
{
dev_warn
(
dev
,
"maximum transfer size exceeded
\n
"
);
return
-
EOPNOTSUPP
;
}
if
(
pmsg
->
flags
&
I2C_M_RD
)
{
ret
=
dln2_i2c_read
(
dln2
,
pmsg
->
addr
,
pmsg
->
buf
,
pmsg
->
len
);
...
...
@@ -187,6 +181,11 @@ static const struct i2c_algorithm dln2_i2c_usb_algorithm = {
.
functionality
=
dln2_i2c_func
,
};
static
struct
i2c_adapter_quirks
dln2_i2c_quirks
=
{
.
max_read_len
=
DLN2_I2C_MAX_XFER_SIZE
,
.
max_write_len
=
DLN2_I2C_MAX_XFER_SIZE
,
};
static
int
dln2_i2c_probe
(
struct
platform_device
*
pdev
)
{
int
ret
;
...
...
@@ -209,6 +208,7 @@ static int dln2_i2c_probe(struct platform_device *pdev)
dln2
->
adapter
.
owner
=
THIS_MODULE
;
dln2
->
adapter
.
class
=
I2C_CLASS_HWMON
;
dln2
->
adapter
.
algo
=
&
dln2_i2c_usb_algorithm
;
dln2
->
adapter
.
quirks
=
&
dln2_i2c_quirks
;
dln2
->
adapter
.
dev
.
parent
=
dev
;
i2c_set_adapdata
(
&
dln2
->
adapter
,
dln2
);
snprintf
(
dln2
->
adapter
.
name
,
sizeof
(
dln2
->
adapter
.
name
),
"%s-%s-%d"
,
...
...
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