summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/dock.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-16 00:09:47 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-16 01:51:16 +0100
commitaf8874491de6f03237df5e20d87324cbbe226f19 (patch)
tree37c742f13666f57d201ca81bf12e40cd91793ff3 /drivers/acpi/dock.c
parentACPI / dock: Pass ACPI device pointer to acpi_device_is_battery() (diff)
downloadlinux-af8874491de6f03237df5e20d87324cbbe226f19.tar.xz
linux-af8874491de6f03237df5e20d87324cbbe226f19.zip
ACPI / dock: Associate dock platform devices with ACPI device objects
To allow user space to check which ACPI device object the dock station is represented by, make acpi_dock_add() indicate to platform_device_register_full() which ACPI device object should be the companion of the new platform device. This also ensures that the ACPI device object in question will not go away while the dock platform device is present (which is always). Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/dock.c')
-rw-r--r--drivers/acpi/dock.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index edeb72b619fb..3199ce950e05 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -768,12 +768,18 @@ static struct attribute_group dock_attribute_group = {
void acpi_dock_add(struct acpi_device *adev)
{
struct dock_station *dock_station, ds = { NULL, };
+ struct platform_device_info pdevinfo;
acpi_handle handle = adev->handle;
struct platform_device *dd;
int ret;
- dd = platform_device_register_data(NULL, "dock", dock_station_count,
- &ds, sizeof(ds));
+ memset(&pdevinfo, 0, sizeof(pdevinfo));
+ pdevinfo.name = "dock";
+ pdevinfo.id = dock_station_count;
+ pdevinfo.acpi_node.companion = adev;
+ pdevinfo.data = &ds;
+ pdevinfo.size_data = sizeof(ds);
+ dd = platform_device_register_full(&pdevinfo);
if (IS_ERR(dd))
return;