All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v2 14/15] media: atomisp: Get rid of ugly and leaky ACPI handling in gmin_subdev_add()
Date: Fri, 26 Jun 2020 15:19:24 +0300	[thread overview]
Message-ID: <20200626121925.14365-15-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20200626121925.14365-1-andriy.shevchenko@linux.intel.com>

First of all ACPI HID is a part of the device name which is printed
as a part of the dev_info(dev, ...); line. Second, since the only BID
is left, it's a part of ACPI path, which can be printed via %pfw.

Get rid of ugly and leaky ACPI handling in gmin_subdev_add() by replacing it
with %pfw.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 .../media/atomisp/pci/atomisp_gmin_platform.c       | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
index d0b9d906a563..7f9e93a9a4b1 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
@@ -463,20 +463,9 @@ static struct gmin_subdev *gmin_subdev_add(struct v4l2_subdev *subdev, struct gm
 {
 	struct i2c_client *client = v4l2_get_subdevdata(subdev);
 	struct device *dev = &client->dev;
-	struct acpi_device *adev;
-	acpi_handle handle;
 	int ret;
 
-	handle = ACPI_HANDLE(dev);
-
-	// FIXME: may need to release resources allocated by acpi_bus_get_device()
-	if (!handle || acpi_bus_get_device(handle, &adev)) {
-		dev_err(dev, "Error could not get ACPI device\n");
-		return NULL;
-	}
-
-	dev_info(&client->dev, "%s: ACPI detected it on bus ID=%s, HID=%s\n",
-		__func__, acpi_device_bid(adev), acpi_device_hid(adev));
+	dev_info(&client->dev, "%s: ACPI path is %pfw\n", __func__, dev_fwnode(dev));
 
 	if (power) {
 		gdev->pwm_i2c_addr = power->addr;
-- 
2.27.0


  parent reply	other threads:[~2020-06-26 12:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26 12:19 [PATCH v2 00/15] media: atomisp: Clean ups and fixes to make it load on Baytrail Andy Shevchenko
2020-06-26 12:19 ` [PATCH v2 01/15] media: atomisp: Replace last use of Intel MID APIs Andy Shevchenko
2020-06-26 12:19 ` [PATCH v2 02/15] media: atomisp: move CCK endpoint address to generic header Andy Shevchenko
2020-06-26 12:19 ` [PATCH v2 03/15] media: atomisp: Use proper APIs to find I²C client device by ACPI HID Andy Shevchenko
2020-06-26 12:19 ` [PATCH v2 04/15] media: atomisp: don't pass struct device_driver as parameter Andy Shevchenko
2020-06-26 12:19 ` [PATCH v2 05/15] media: atomisp: Get rid of struct pci_dev in struct atomisp_device Andy Shevchenko
2020-06-26 12:19 ` [PATCH v2 06/15] media: atomisp: Unify pdev to be pointer to struct pci_device Andy Shevchenko
2020-06-26 12:19 ` [PATCH v2 07/15] media: atomisp: Replace direct access to MMIO with proper helpers Andy Shevchenko
2020-06-26 12:19 ` [PATCH v2 08/15] media: atomisp: Drop global atomisp_dev variable (easy cases) Andy Shevchenko
2020-06-26 12:19 ` [PATCH v2 09/15] media: atomisp: make platform data more readable Andy Shevchenko
2020-06-26 12:19 ` [PATCH v2 10/15] media: atomisp: Don't try to parse unexpected ACPI object type Andy Shevchenko
2020-06-26 12:19 ` [PATCH v2 11/15] media: atomisp: Make pointer to PMIC client global Andy Shevchenko
2020-06-26 12:19 ` [PATCH v2 12/15] media: atomisp: Refactor PMIC detection to a separate function Andy Shevchenko
2020-06-26 12:19 ` [PATCH v2 13/15] media: atomisp: Provide Gmin subdev as parameter to gmin_subdev_add() Andy Shevchenko
2020-06-26 12:19 ` Andy Shevchenko [this message]
2020-06-26 12:19 ` [PATCH v2 15/15] media: atomisp: Deduplicate return ret in gmin_i2c_write() Andy Shevchenko
2020-06-26 13:29 ` [PATCH v2 00/15] media: atomisp: Clean ups and fixes to make it load on Baytrail Mauro Carvalho Chehab
2020-06-26 14:01   ` Mauro Carvalho Chehab
2020-06-29 10:53     ` 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=20200626121925.14365-15-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=linux-media@vger.kernel.org \
    --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 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.