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
4efe6065
Commit
4efe6065
authored
Nov 17, 2014
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
greybus: vibrator-gb: fixes based on Marti's review comments.
Signed-off-by:
Greg Kroah-Hartman
<
greg@kroah.com
>
parent
ac4029fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
18 deletions
+12
-18
drivers/staging/greybus/kernel_ver.h
drivers/staging/greybus/kernel_ver.h
+7
-7
drivers/staging/greybus/vibrator-gb.c
drivers/staging/greybus/vibrator-gb.c
+5
-11
No files found.
drivers/staging/greybus/kernel_ver.h
View file @
4efe6065
...
...
@@ -13,6 +13,13 @@
#ifndef __GREYBUS_KERNEL_VER_H
#define __GREYBUS_KERNEL_VER_H
#ifndef __ATTR_WO
#define __ATTR_WO(_name) { \
.attr = { .name = __stringify(_name), .mode = S_IWUSR }, \
.store = _name##_store, \
}
#endif
#ifndef DEVICE_ATTR_RO
#define DEVICE_ATTR_RO(_name) \
struct device_attribute dev_attr_##_name = __ATTR_RO(_name)
...
...
@@ -23,13 +30,6 @@
struct device_attribute dev_attr_##_name = __ATTR_WO(_name)
#endif
#ifndef __ATTR_WO
#define __ATTR_WO(_name) { \
.attr = { .name = __stringify(_name), .mode = S_IWUSR }, \
.store = _name##_store, \
}
#endif
#ifndef U8_MAX
#define U8_MAX ((u8)~0U)
#endif
/* ! U8_MAX */
...
...
drivers/staging/greybus/vibrator-gb.c
View file @
4efe6065
/*
*
I2C bridge driver for the Greybus "generic" I2C module
.
*
Greybus Vibrator protocol driver
.
*
* Copyright 2014 Google Inc.
*
...
...
@@ -153,20 +153,13 @@ static int turn_on(struct gb_vibrator_device *vib, u16 timeout_ms)
gb_operation_destroy
(
operation
);
return
retval
;
return
0
;
}
static
int
turn_off
(
struct
gb_vibrator_device
*
vib
)
{
struct
gb_connection
*
connection
=
vib
->
connection
;
int
retval
;
retval
=
request_operation
(
connection
,
GB_VIBRATOR_TYPE_OFF
,
NULL
,
0
);
if
(
retval
)
return
retval
;
return
0
;
return
request_operation
(
connection
,
GB_VIBRATOR_TYPE_OFF
,
NULL
,
0
);
}
static
ssize_t
timeout_store
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
...
...
@@ -232,7 +225,7 @@ static int gb_vibrator_connection_init(struct gb_connection *connection)
* are there is a "real" device somewhere in the kernel for this, but I
* can't find it at the moment...
*/
dev
=
device_create
(
&
vibrator_class
,
NULL
,
MKDEV
(
0
,
0
),
vib
,
dev
=
device_create
(
&
vibrator_class
,
&
connection
->
dev
,
MKDEV
(
0
,
0
),
vib
,
"vibrator%d"
,
minor
);
if
(
IS_ERR
(
dev
))
{
retval
=
-
EINVAL
;
...
...
@@ -243,7 +236,8 @@ static int gb_vibrator_connection_init(struct gb_connection *connection)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,11,0)
/*
* Newer kernels handle this in a race-free manner, for us, we need
* Newer kernels handle this in a race-free manner, by the dev_groups
* field in the struct class up above. But for older kernels, we need
* to "open code this :(
*/
retval
=
sysfs_create_group
(
&
dev
->
kobj
,
vibrator_groups
[
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