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
f1eec30a
Commit
f1eec30a
authored
Aug 30, 2014
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
greybus: first framework for the es1 ap controller
parent
8bf23e84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
drivers/staging/greybus/es1-ap-usb.c
drivers/staging/greybus/es1-ap-usb.c
+23
-0
No files found.
drivers/staging/greybus/es1-ap-usb.c
View file @
f1eec30a
...
...
@@ -18,17 +18,40 @@ static const struct usb_device_id id_table[] = {
};
MODULE_DEVICE_TABLE
(
usb
,
id_table
);
/*
* Hack, we "know" we will only have one of these at any one time, so only
* create one static structure pointer.
*/
struct
es1_ap_dev
{
struct
usb_interface
*
usb_intf
;
}
*
es1_ap_dev
;
static
int
ap_probe
(
struct
usb_interface
*
interface
,
const
struct
usb_device_id
*
id
)
{
if
(
es1_ap_dev
)
{
dev_err
(
&
interface
->
dev
,
"Already have a es1_ap_dev???
\n
"
);
return
-
ENODEV
;
}
es1_ap_dev
=
kzalloc
(
sizeof
(
*
es1_ap_dev
),
GFP_KERNEL
);
if
(
!
es1_ap_dev
)
return
-
ENOMEM
;
es1_ap_dev
->
usb_intf
=
interface
;
usb_set_intfdata
(
interface
,
es1_ap_dev
);
return
0
;
}
static
void
ap_disconnect
(
struct
usb_interface
*
interface
)
{
es1_ap_dev
=
usb_get_intfdata
(
interface
);
/* Tear down everything! */
kfree
(
es1_ap_dev
);
es1_ap_dev
=
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