From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: ACPI Devel Maling List <linux-acpi@vger.kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>
Subject: [PATCH 3/3] ACPI / dock: Associate dock platform devices with ACPI device objects
Date: Tue, 11 Feb 2014 01:11:25 +0100 [thread overview]
Message-ID: <4270057.BdBl87QbAX@vostro.rjw.lan> (raw)
In-Reply-To: <3728252.WpMGKRKmqq@vostro.rjw.lan>
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
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>
---
drivers/acpi/dock.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
Index: linux-pm/drivers/acpi/dock.c
===================================================================
--- linux-pm.orig/drivers/acpi/dock.c
+++ linux-pm/drivers/acpi/dock.c
@@ -771,12 +771,18 @@ static struct attribute_group dock_attri
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;
prev parent reply other threads:[~2014-02-10 23:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-11 0:09 [PATCH 0/3] ACPI / dock: Rework the handling of dock notifications Rafael J. Wysocki
2014-02-11 0:10 ` [PATCH 1/3] ACPI / dock: Dispatch dock notifications from the global notify handler Rafael J. Wysocki
2014-02-14 0:45 ` [Update][PATCH " Rafael J. Wysocki
2014-02-11 0:10 ` [PATCH 2/3] ACPI / dock: Pass ACPI device pointer to acpi_device_is_battery() Rafael J. Wysocki
2014-02-11 0:11 ` Rafael J. Wysocki [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4270057.BdBl87QbAX@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=bhelgaas@google.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®