All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wilczynski <michal.wilczynski@intel.com>
To: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	nvdimm@lists.linux.dev
Cc: rafael.j.wysocki@intel.com, andriy.shevchenko@intel.com,
	lenb@kernel.org, dan.j.williams@intel.com,
	vishal.l.verma@intel.com, ira.weiny@intel.com,
	Michal Wilczynski <michal.wilczynski@intel.com>
Subject: [PATCH v2 4/6] ACPI: AC: Rename ACPI device from device to adev
Date: Fri,  6 Oct 2023 20:30:53 +0300	[thread overview]
Message-ID: <20231006173055.2938160-5-michal.wilczynski@intel.com> (raw)
In-Reply-To: <20231006173055.2938160-1-michal.wilczynski@intel.com>

Since transformation from ACPI driver to platform driver there are two
devices on which the driver operates - ACPI device and platform device.
For the sake of reader this calls for the distinction in their naming,
to avoid confusion. Rename device to adev, as corresponding
platform device is called pdev.

Signed-off-by: Michal Wilczynski <michal.wilczynski@intel.com>
---
 drivers/acpi/ac.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 298defeb5301..bb02e7f5d65a 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -120,7 +120,7 @@ static enum power_supply_property ac_props[] = {
 static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
 {
 	struct acpi_ac *ac = data;
-	struct acpi_device *device = ACPI_COMPANION(ac->dev);
+	struct acpi_device *adev = ACPI_COMPANION(ac->dev);
 
 	switch (event) {
 	default:
@@ -141,11 +141,11 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
 			msleep(ac_sleep_before_get_state_ms);
 
 		acpi_ac_get_state(ac);
-		acpi_bus_generate_netlink_event(device->pnp.device_class,
+		acpi_bus_generate_netlink_event(adev->pnp.device_class,
 						dev_name(ac->dev),
 						event,
 						ac->state);
-		acpi_notifier_call_chain(device, event, ac->state);
+		acpi_notifier_call_chain(adev, event, ac->state);
 		kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE);
 	}
 }
@@ -204,7 +204,7 @@ static const struct dmi_system_id ac_dmi_table[]  __initconst = {
 
 static int acpi_ac_probe(struct platform_device *pdev)
 {
-	struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
+	struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
 	struct power_supply_config psy_cfg = {};
 	struct acpi_ac *ac;
 	int result;
@@ -214,8 +214,8 @@ static int acpi_ac_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	ac->dev = &pdev->dev;
-	strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME);
-	strcpy(acpi_device_class(device), ACPI_AC_CLASS);
+	strcpy(acpi_device_name(adev), ACPI_AC_DEVICE_NAME);
+	strcpy(acpi_device_class(adev), ACPI_AC_CLASS);
 
 	platform_set_drvdata(pdev, ac);
 
@@ -225,7 +225,7 @@ static int acpi_ac_probe(struct platform_device *pdev)
 
 	psy_cfg.drv_data = ac;
 
-	ac->charger_desc.name = acpi_device_bid(device);
+	ac->charger_desc.name = acpi_device_bid(adev);
 	ac->charger_desc.type = POWER_SUPPLY_TYPE_MAINS;
 	ac->charger_desc.properties = ac_props;
 	ac->charger_desc.num_properties = ARRAY_SIZE(ac_props);
@@ -237,13 +237,13 @@ static int acpi_ac_probe(struct platform_device *pdev)
 		goto err_release_ac;
 	}
 
-	pr_info("%s [%s] (%s-line)\n", acpi_device_name(device),
-		acpi_device_bid(device), str_on_off(ac->state));
+	pr_info("%s [%s] (%s-line)\n", acpi_device_name(adev),
+		acpi_device_bid(adev), str_on_off(ac->state));
 
 	ac->battery_nb.notifier_call = acpi_ac_battery_notify;
 	register_acpi_notifier(&ac->battery_nb);
 
-	result = acpi_dev_install_notify_handler(device, ACPI_ALL_NOTIFY,
+	result = acpi_dev_install_notify_handler(adev, ACPI_ALL_NOTIFY,
 						 acpi_ac_notify, ac);
 	if (result)
 		goto err_unregister;
-- 
2.41.0


  parent reply	other threads:[~2023-10-06 17:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 17:30 [PATCH v2 0/6] Replace acpi_driver with platform_driver Michal Wilczynski
2023-10-06 17:30 ` [PATCH v2 1/6] ACPI: AC: Remove unnecessary checks Michal Wilczynski
2023-10-06 17:30 ` [PATCH v2 2/6] ACPI: AC: Use string_choices API instead of ternary operator Michal Wilczynski
2023-10-06 17:30 ` [PATCH v2 3/6] ACPI: AC: Replace acpi_driver with platform_driver Michal Wilczynski
2023-10-06 17:45   ` Andy Shevchenko
2023-10-06 19:47   ` Rafael J. Wysocki
2023-10-07  7:56     ` Andy Shevchenko
2023-10-07 10:41       ` Rafael J. Wysocki
2023-10-07 10:43         ` Rafael J. Wysocki
2023-10-09  8:40           ` Wilczynski, Michal
2023-10-09 12:27             ` Rafael J. Wysocki
2023-10-09 13:03               ` Wilczynski, Michal
2023-10-09 17:51                 ` Rafael J. Wysocki
2023-10-06 17:30 ` Michal Wilczynski [this message]
2023-10-06 17:30 ` [PATCH v2 5/6] ACPI: NFIT: " Michal Wilczynski
2023-10-17  8:51   ` Wilczynski, Michal
2023-10-17 10:55     ` Rafael J. Wysocki
2023-10-17 14:06   ` Rafael J. Wysocki
2023-10-17 18:24   ` Dan Williams
2023-10-18 15:38     ` Wilczynski, Michal
2023-10-06 17:30 ` [PATCH v2 6/6] ACPI: NFIT: Remove redundant call to to_acpi_dev() Michal Wilczynski

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=20231006173055.2938160-5-michal.wilczynski@intel.com \
    --to=michal.wilczynski@intel.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=rafael.j.wysocki@intel.com \
    --cc=vishal.l.verma@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.