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
b10b977b
Commit
b10b977b
authored
Oct 25, 2010
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pnpacpi-invalid-device-id' into release
parents
22156ea7
420a0f66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
drivers/pnp/pnpacpi/core.c
drivers/pnp/pnpacpi/core.c
+24
-5
No files found.
drivers/pnp/pnpacpi/core.c
View file @
b10b977b
...
...
@@ -28,7 +28,7 @@
#include "../base.h"
#include "pnpacpi.h"
static
int
num
=
0
;
static
int
num
;
/* We need only to blacklist devices that have already an acpi driver that
* can't use pnp layer. We don't need to blacklist device that are directly
...
...
@@ -180,11 +180,24 @@ struct pnp_protocol pnpacpi_protocol = {
};
EXPORT_SYMBOL
(
pnpacpi_protocol
);
static
char
*
pnpacpi_get_id
(
struct
acpi_device
*
device
)
{
struct
acpi_hardware_id
*
id
;
list_for_each_entry
(
id
,
&
device
->
pnp
.
ids
,
list
)
{
if
(
ispnpidacpi
(
id
->
id
))
return
id
->
id
;
}
return
NULL
;
}
static
int
__init
pnpacpi_add_device
(
struct
acpi_device
*
device
)
{
acpi_handle
temp
=
NULL
;
acpi_status
status
;
struct
pnp_dev
*
dev
;
char
*
pnpid
;
struct
acpi_hardware_id
*
id
;
/*
...
...
@@ -192,11 +205,17 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
* driver should not be loaded.
*/
status
=
acpi_get_handle
(
device
->
handle
,
"_CRS"
,
&
temp
);
if
(
ACPI_FAILURE
(
status
)
||
!
ispnpidacpi
(
acpi_device_hid
(
device
))
||
is_exclusive_device
(
device
)
||
(
!
device
->
status
.
present
))
if
(
ACPI_FAILURE
(
status
))
return
0
;
pnpid
=
pnpacpi_get_id
(
device
);
if
(
!
pnpid
)
return
0
;
if
(
is_exclusive_device
(
device
)
||
!
device
->
status
.
present
)
return
0
;
dev
=
pnp_alloc_dev
(
&
pnpacpi_protocol
,
num
,
acpi_device_hid
(
device
)
);
dev
=
pnp_alloc_dev
(
&
pnpacpi_protocol
,
num
,
pnpid
);
if
(
!
dev
)
return
-
ENOMEM
;
...
...
@@ -227,7 +246,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
pnpacpi_parse_resource_option_data
(
dev
);
list_for_each_entry
(
id
,
&
device
->
pnp
.
ids
,
list
)
{
if
(
!
strcmp
(
id
->
id
,
acpi_device_hid
(
device
)
))
if
(
!
strcmp
(
id
->
id
,
pnpid
))
continue
;
if
(
!
ispnpidacpi
(
id
->
id
))
continue
;
...
...
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