ACPI_COMPANION equivalent in older kernels
For backporting a driver to 3.11 kernel I would like to know how to get same functionality as ACPI_COMPANION(). I did it like below, but would like to have some confirmation on it.
Regards,
Arend --8<------------------------------------------------------------------ static inline
struct acpi_device *_acpi_get_companion(struct device *dev)
{
struct acpi_device *adev;
int ret;
ret = acpi_bus_get_device(ACPI_HANDLE(dev), &adev);
if (ret < 0)
adev = NULL;
return adev;
}#define ACPI_COMPANION(dev) _acpi_get_companion(dev)
Quoted 3 lines · Arend van Spriel
For backporting a driver to 3.11 kernel I would like to know how to get same functionality as
ACPI_COMPANION(). I did it like below, but would like to have some confirmation on it.
Yes, that should work in general.
Quoted 18 lines
--8<------------------------------------------------------------------ static inline
structacpi_device*_acpi_get_companion(struct device *dev){ struct acpi_device *adev; int ret; ret = acpi_bus_get_device(ACPI_HANDLE(dev), &adev); if (ret < 0) adev = NULL; return adev; }#define
ACPI_COMPANION(dev)_acpi_get_companion(dev)
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.