All of lore.kernel.org
 help / color / mirror / Atom feed
* ACPI_COMPANION equivalent in older kernels
@ 2015-06-10 14:17 Arend van Spriel
  2015-06-11  0:02 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Arend van Spriel @ 2015-06-10 14:17 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: ACPI Devel Maling List

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-10 23:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-10 14:17 ACPI_COMPANION equivalent in older kernels Arend van Spriel
2015-06-11  0:02 ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.