Commit ab93048
ACPI: property: Fix return value for nval == 0 in acpi_data_prop_read()
While analysing code for software and OF node for the corner case when
caller asks to read zero items in the supposed to be an array of values
I found that ACPI behaves differently to what OF does, i.e.
1. It returns -EINVAL when caller asks to read zero items from integer
array, while OF returns 0, if no other errors happened.
2. It returns -EINVAL when caller asks to read zero items from string
array, while OF returns -ENODATA, if no other errors happened.
Amend ACPI implementation to follow what OF does.
Fixes: b31384f ("Driver core: Unified device properties interface for platform firmware")
Signed-off-by: Andy Shevchenko <[email protected]>
Link: https://patch.msgid.link/[email protected]
[ rjw: Added empty line after a conditional ]
Signed-off-by: Rafael J. Wysocki <[email protected]>1 parent 2014c95 commit ab93048
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1187 | 1187 | | |
1188 | 1188 | | |
1189 | 1189 | | |
1190 | | - | |
1191 | | - | |
1192 | 1190 | | |
1193 | 1191 | | |
1194 | 1192 | | |
| |||
1212 | 1210 | | |
1213 | 1211 | | |
1214 | 1212 | | |
1215 | | - | |
1216 | | - | |
1217 | | - | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
1218 | 1218 | | |
1219 | 1219 | | |
1220 | 1220 | | |
| |||
0 commit comments