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
291f3b9e
Commit
291f3b9e
authored
Sep 01, 2014
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
greybus: serial number attribute added
parent
b94295e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
drivers/staging/greybus/core.c
drivers/staging/greybus/core.c
+32
-1
No files found.
drivers/staging/greybus/core.c
View file @
291f3b9e
...
...
@@ -169,7 +169,6 @@ static void greybus_module_release(struct device *dev)
}
static
struct
device_type
greybus_module_type
=
{
.
name
=
"greybus_module"
,
.
release
=
greybus_module_release
,
...
...
@@ -222,8 +221,40 @@ static struct attribute_group function_addr_grp = {
.
is_visible
=
function_attrs_are_visible
,
};
#if 0
struct greybus_descriptor_module_id {
__le16 vendor;
__le16 product;
__le16 version;
__u8 vendor_stringid;
__u8 product_stringid;
};
#endif
/* Serial Number */
static
ssize_t
serial_number_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
struct
greybus_device
*
gdev
=
to_greybus_device
(
dev
);
return
sprintf
(
buf
,
"%llX
\n
"
,
(
unsigned
long
long
)
gdev
->
serial_number
.
serial_number
);
}
static
DEVICE_ATTR_RO
(
serial_number
);
static
struct
attribute
*
serial_number_attrs
[]
=
{
&
dev_attr_serial_number
.
attr
,
NULL
,
};
static
struct
attribute_group
serial_number_grp
=
{
.
attrs
=
serial_number_attrs
,
.
is_visible
=
function_attrs_are_visible
,
};
static
const
struct
attribute_group
*
greybus_module_groups
[]
=
{
&
function_addr_grp
,
&
serial_number_grp
,
NULL
,
};
...
...
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