Skip to content

Commit c7b5937

Browse files
mwilczyrafaeljw
authored andcommitted
ACPI: AC: Rename ACPI device from device to adev
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 5829046 commit c7b5937

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

drivers/acpi/ac.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ static enum power_supply_property ac_props[] = {
120120
static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
121121
{
122122
struct acpi_ac *ac = data;
123-
struct acpi_device *device = ac->device;
123+
struct acpi_device *adev = ac->device;
124124

125125
switch (event) {
126126
default:
127-
acpi_handle_debug(device->handle, "Unsupported event [0x%x]\n",
127+
acpi_handle_debug(adev->handle, "Unsupported event [0x%x]\n",
128128
event);
129129
fallthrough;
130130
case ACPI_AC_NOTIFY_STATUS:
@@ -141,10 +141,10 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
141141
msleep(ac_sleep_before_get_state_ms);
142142

143143
acpi_ac_get_state(ac);
144-
acpi_bus_generate_netlink_event(device->pnp.device_class,
145-
dev_name(&device->dev), event,
144+
acpi_bus_generate_netlink_event(adev->pnp.device_class,
145+
dev_name(&adev->dev), event,
146146
(u32) ac->state);
147-
acpi_notifier_call_chain(device, event, (u32) ac->state);
147+
acpi_notifier_call_chain(adev, event, (u32) ac->state);
148148
kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE);
149149
}
150150
}
@@ -203,7 +203,7 @@ static const struct dmi_system_id ac_dmi_table[] __initconst = {
203203

204204
static int acpi_ac_probe(struct platform_device *pdev)
205205
{
206-
struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
206+
struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
207207
struct power_supply_config psy_cfg = {};
208208
struct acpi_ac *ac;
209209
int result;
@@ -212,9 +212,9 @@ static int acpi_ac_probe(struct platform_device *pdev)
212212
if (!ac)
213213
return -ENOMEM;
214214

215-
ac->device = device;
216-
strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME);
217-
strcpy(acpi_device_class(device), ACPI_AC_CLASS);
215+
ac->device = adev;
216+
strcpy(acpi_device_name(adev), ACPI_AC_DEVICE_NAME);
217+
strcpy(acpi_device_class(adev), ACPI_AC_CLASS);
218218

219219
platform_set_drvdata(pdev, ac);
220220

@@ -224,7 +224,7 @@ static int acpi_ac_probe(struct platform_device *pdev)
224224

225225
psy_cfg.drv_data = ac;
226226

227-
ac->charger_desc.name = acpi_device_bid(device);
227+
ac->charger_desc.name = acpi_device_bid(adev);
228228
ac->charger_desc.type = POWER_SUPPLY_TYPE_MAINS;
229229
ac->charger_desc.properties = ac_props;
230230
ac->charger_desc.num_properties = ARRAY_SIZE(ac_props);
@@ -236,13 +236,13 @@ static int acpi_ac_probe(struct platform_device *pdev)
236236
goto err_release_ac;
237237
}
238238

239-
pr_info("%s [%s] (%s-line)\n", acpi_device_name(device),
240-
acpi_device_bid(device), str_on_off(ac->state));
239+
pr_info("%s [%s] (%s-line)\n", acpi_device_name(adev),
240+
acpi_device_bid(adev), str_on_off(ac->state));
241241

242242
ac->battery_nb.notifier_call = acpi_ac_battery_notify;
243243
register_acpi_notifier(&ac->battery_nb);
244244

245-
result = acpi_dev_install_notify_handler(device, ACPI_ALL_NOTIFY,
245+
result = acpi_dev_install_notify_handler(adev, ACPI_ALL_NOTIFY,
246246
acpi_ac_notify, ac);
247247
if (result)
248248
goto err_unregister;

0 commit comments

Comments
 (0)