From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>,
linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 2/2] media: atomisp: Replace open-coded i2c_find_device_by_fwnode()
Date: Tue, 26 Mar 2024 22:27:03 +0200 [thread overview]
Message-ID: <20240326202813.1425431-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20240326202813.1425431-1-andriy.shevchenko@linux.intel.com>
gmin_i2c_dev_exists() is using open-coded variant of
i2c_find_device_by_fwnode(). Replace it with a corresponding call.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
index 80aa2211cdc3..b7c477280986 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
@@ -394,12 +394,10 @@ static struct i2c_client *gmin_i2c_dev_exists(struct device *dev, char *name,
if (!adev)
return NULL;
- d = bus_find_device_by_acpi_dev(&i2c_bus_type, adev);
+ d = get_device(acpi_get_first_physical_node(adev));
acpi_dev_put(adev);
- if (!d)
- return NULL;
- *client = i2c_verify_client(d);
+ *client = i2c_find_device_by_fwnode(dev_fwnode(d));
put_device(d);
dev_dbg(dev, "found '%s' at address 0x%02x, adapter %d\n",
--
2.43.0.rc1.1.gbec44491f096
next prev parent reply other threads:[~2024-03-26 20:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-26 20:27 [PATCH v1 0/2] media: atomisp: Fix and refactor PMIC I²C discovery Andy Shevchenko
2024-03-26 20:27 ` [PATCH v1 1/2] media: atomisp: Put PMIC device after getting its I²C address Andy Shevchenko
2024-04-10 10:41 ` Hans de Goede
2024-03-26 20:27 ` Andy Shevchenko [this message]
2024-04-10 10:35 ` [PATCH v1 2/2] media: atomisp: Replace open-coded i2c_find_device_by_fwnode() Hans de Goede
2024-04-10 13:35 ` Andy Shevchenko
2024-04-10 13:41 ` Hans de Goede
2024-04-10 13:49 ` Andy Shevchenko
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=20240326202813.1425431-3-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.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 read-only IMAP folder(s) and NNTP newsgroup(s).