From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Elie Morisse <syniurge@gmail.com>,
Nehal Shah <nehal-bakulchandra.shah@amd.com>,
Shyam Sundar S K <shyam-sundar.s-k@amd.com>,
linux-i2c@vger.kernel.org
Subject: [PATCH v2 3/7] i2c: i2c-amd-mp2-plat: ACPI: Use ACPI_COMPANION() directly
Date: Wed, 13 Oct 2021 18:09:39 +0200 [thread overview]
Message-ID: <1823250.tdWV9SEqCh@kreacher> (raw)
In-Reply-To: <3647069.kQq0lBPeGt@kreacher>
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
The ACPI_HANDLE() macro is a wrapper arond the ACPI_COMPANION()
macro and the ACPI handle produced by the former comes from the
ACPI device object produced by the latter, so it is way more
straightforward to evaluate the latter directly instead of passing
the handle produced by the former to acpi_bus_get_device().
Modify i2c_amd_probe() accordingly (no intentional functional impact).
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
---
v1 -> v2:
* Resend with a different From and S-o-b address and with maintainer ACK.
No other changes.
---
drivers/i2c/busses/i2c-amd-mp2-plat.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Index: linux-pm/drivers/i2c/busses/i2c-amd-mp2-plat.c
===================================================================
--- linux-pm.orig/drivers/i2c/busses/i2c-amd-mp2-plat.c
+++ linux-pm/drivers/i2c/busses/i2c-amd-mp2-plat.c
@@ -246,12 +246,11 @@ static int i2c_amd_probe(struct platform
{
int ret;
struct amd_i2c_dev *i2c_dev;
- acpi_handle handle = ACPI_HANDLE(&pdev->dev);
- struct acpi_device *adev;
+ struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
struct amd_mp2_dev *mp2_dev;
const char *uid;
- if (acpi_bus_get_device(handle, &adev))
+ if (!adev)
return -ENODEV;
/* The ACPI namespace doesn't contain information about which MP2 PCI
next prev parent reply other threads:[~2021-10-13 16:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4369779.LvFx2qVVIh@kreacher>
2021-10-12 17:44 ` [PATCH v1 3/7] i2c: i2c-amd-mp2-plat: ACPI: Use ACPI_COMPANION() directly Rafael J. Wysocki
2021-10-12 18:12 ` Shyam Sundar S K
2021-10-13 16:09 ` Rafael J. Wysocki [this message]
2021-10-17 14:22 ` [PATCH v2 " Wolfram Sang
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=1823250.tdWV9SEqCh@kreacher \
--to=rjw@rjwysocki.net \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nehal-bakulchandra.shah@amd.com \
--cc=shyam-sundar.s-k@amd.com \
--cc=syniurge@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).