ACPI / bus: Return error code from __acpi_match_device() in one case
PATCH v2 1/6 ACPI / bus: Return error code from __acpi_match_device() in one case
Quoted 10 lines · Rafael J. Wysocki
Quoted 7 lines · Andy Shevchenko
Instead of playing tricks with last invalid entry, return simple
-ENODATAerror code casted to pointer.It would be good for future in case caller passes NULL pointer for ID table. Moreover, caller can check the code to be sure what happened
inside callee.
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +1
-1- return id; + return ERR_PTR(-ENODATA);So why is returning id from here a problem?
I think you already noticed that in the following patch it becomes a problem if user supply ids == NULL.
That's why I added a second paragraph to the commit message to explain.