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
0b8a53a8
Commit
0b8a53a8
authored
Jul 23, 2021
by
Rafael J. Wysocki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'acpi-utils'
* acpi-utils: ACPI: utils: Fix reference counting in for_each_acpi_dev_match()
parents
d2cbbf1f
71f64283
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
14 deletions
+5
-14
drivers/acpi/utils.c
drivers/acpi/utils.c
+3
-4
drivers/firmware/efi/dev-path-parser.c
drivers/firmware/efi/dev-path-parser.c
+0
-1
drivers/media/pci/intel/ipu3/cio2-bridge.c
drivers/media/pci/intel/ipu3/cio2-bridge.c
+2
-4
include/acpi/acpi_bus.h
include/acpi/acpi_bus.h
+0
-5
No files found.
drivers/acpi/utils.c
View file @
0b8a53a8
...
@@ -860,11 +860,9 @@ EXPORT_SYMBOL(acpi_dev_present);
...
@@ -860,11 +860,9 @@ EXPORT_SYMBOL(acpi_dev_present);
* Return the next match of ACPI device if another matching device was present
* Return the next match of ACPI device if another matching device was present
* at the moment of invocation, or NULL otherwise.
* at the moment of invocation, or NULL otherwise.
*
*
* FIXME: The function does not tolerate the sudden disappearance of @adev, e.g.
* in the case of a hotplug event. That said, the caller should ensure that
* this will never happen.
*
* The caller is responsible for invoking acpi_dev_put() on the returned device.
* The caller is responsible for invoking acpi_dev_put() on the returned device.
* On the other hand the function invokes acpi_dev_put() on the given @adev
* assuming that its reference counter had been increased beforehand.
*
*
* See additional information in acpi_dev_present() as well.
* See additional information in acpi_dev_present() as well.
*/
*/
...
@@ -880,6 +878,7 @@ acpi_dev_get_next_match_dev(struct acpi_device *adev, const char *hid, const cha
...
@@ -880,6 +878,7 @@ acpi_dev_get_next_match_dev(struct acpi_device *adev, const char *hid, const cha
match
.
hrv
=
hrv
;
match
.
hrv
=
hrv
;
dev
=
bus_find_device
(
&
acpi_bus_type
,
start
,
&
match
,
acpi_dev_match_cb
);
dev
=
bus_find_device
(
&
acpi_bus_type
,
start
,
&
match
,
acpi_dev_match_cb
);
acpi_dev_put
(
adev
);
return
dev
?
to_acpi_device
(
dev
)
:
NULL
;
return
dev
?
to_acpi_device
(
dev
)
:
NULL
;
}
}
EXPORT_SYMBOL
(
acpi_dev_get_next_match_dev
);
EXPORT_SYMBOL
(
acpi_dev_get_next_match_dev
);
...
...
drivers/firmware/efi/dev-path-parser.c
View file @
0b8a53a8
...
@@ -34,7 +34,6 @@ static long __init parse_acpi_path(const struct efi_dev_path *node,
...
@@ -34,7 +34,6 @@ static long __init parse_acpi_path(const struct efi_dev_path *node,
break
;
break
;
if
(
!
adev
->
pnp
.
unique_id
&&
node
->
acpi
.
uid
==
0
)
if
(
!
adev
->
pnp
.
unique_id
&&
node
->
acpi
.
uid
==
0
)
break
;
break
;
acpi_dev_put
(
adev
);
}
}
if
(
!
adev
)
if
(
!
adev
)
return
-
ENODEV
;
return
-
ENODEV
;
...
...
drivers/media/pci/intel/ipu3/cio2-bridge.c
View file @
0b8a53a8
...
@@ -173,10 +173,8 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg,
...
@@ -173,10 +173,8 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg,
int
ret
;
int
ret
;
for_each_acpi_dev_match
(
adev
,
cfg
->
hid
,
NULL
,
-
1
)
{
for_each_acpi_dev_match
(
adev
,
cfg
->
hid
,
NULL
,
-
1
)
{
if
(
!
adev
->
status
.
enabled
)
{
if
(
!
adev
->
status
.
enabled
)
acpi_dev_put
(
adev
);
continue
;
continue
;
}
if
(
bridge
->
n_sensors
>=
CIO2_NUM_PORTS
)
{
if
(
bridge
->
n_sensors
>=
CIO2_NUM_PORTS
)
{
acpi_dev_put
(
adev
);
acpi_dev_put
(
adev
);
...
@@ -185,7 +183,6 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg,
...
@@ -185,7 +183,6 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg,
}
}
sensor
=
&
bridge
->
sensors
[
bridge
->
n_sensors
];
sensor
=
&
bridge
->
sensors
[
bridge
->
n_sensors
];
sensor
->
adev
=
adev
;
strscpy
(
sensor
->
name
,
cfg
->
hid
,
sizeof
(
sensor
->
name
));
strscpy
(
sensor
->
name
,
cfg
->
hid
,
sizeof
(
sensor
->
name
));
ret
=
cio2_bridge_read_acpi_buffer
(
adev
,
"SSDB"
,
ret
=
cio2_bridge_read_acpi_buffer
(
adev
,
"SSDB"
,
...
@@ -215,6 +212,7 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg,
...
@@ -215,6 +212,7 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg,
goto
err_free_swnodes
;
goto
err_free_swnodes
;
}
}
sensor
->
adev
=
acpi_dev_get
(
adev
);
adev
->
fwnode
.
secondary
=
fwnode
;
adev
->
fwnode
.
secondary
=
fwnode
;
dev_info
(
&
cio2
->
dev
,
"Found supported sensor %s
\n
"
,
dev_info
(
&
cio2
->
dev
,
"Found supported sensor %s
\n
"
,
...
...
include/acpi/acpi_bus.h
View file @
0b8a53a8
...
@@ -707,11 +707,6 @@ acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv);
...
@@ -707,11 +707,6 @@ acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv);
* @hrv: Hardware Revision of the device, pass -1 to not check _HRV
* @hrv: Hardware Revision of the device, pass -1 to not check _HRV
*
*
* The caller is responsible for invoking acpi_dev_put() on the returned device.
* The caller is responsible for invoking acpi_dev_put() on the returned device.
*
* FIXME: Due to above requirement there is a window that may invalidate @adev
* and next iteration will use a dangling pointer, e.g. in the case of a
* hotplug event. That said, the caller should ensure that this will never
* happen.
*/
*/
#define for_each_acpi_dev_match(adev, hid, uid, hrv) \
#define for_each_acpi_dev_match(adev, hid, uid, hrv) \
for (adev = acpi_dev_get_first_match_dev(hid, uid, hrv); \
for (adev = acpi_dev_get_first_match_dev(hid, uid, hrv); \
...
...
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