Skip to content

Commit 228b79a

Browse files
committed
Merge branches 'acpi-processor', 'acpi-cppc', 'acpi-dbg', 'acpi-misc' and 'acpi-pci'
* acpi-processor: ACPI: processor: idle: Allow probing on platforms with one ACPI C-state * acpi-cppc: ACPI: CPPC: Fix reference count leak in acpi_cppc_processor_probe() ACPI: CPPC: Make some symbols static * acpi-dbg: ACPI: debug: Make two functions static * acpi-misc: ACPI: GED: use correct trigger type field in _Exx / _Lxx handling ACPI: GED: add support for _Exx / _Lxx handler methods ACPI: Delete unused proc filename macros * acpi-pci: ACPI: hotplug: PCI: Use the new acpi_evaluate_reg() helper ACPI: utils: Add acpi_evaluate_reg() helper
6 parents 48c6041 + 496121c + 4d8be4b + 8e22c2e + e5c399b + 6dd10c4 commit 228b79a

File tree

12 files changed

+55
-33
lines changed

12 files changed

+55
-33
lines changed

drivers/acpi/acpi_dbg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ static const struct acpi_debugger_ops acpi_aml_debugger = {
745745
.notify_command_complete = acpi_aml_notify_command_complete,
746746
};
747747

748-
int __init acpi_aml_init(void)
748+
static int __init acpi_aml_init(void)
749749
{
750750
int ret;
751751

@@ -771,7 +771,7 @@ int __init acpi_aml_init(void)
771771
return 0;
772772
}
773773

774-
void __exit acpi_aml_exit(void)
774+
static void __exit acpi_aml_exit(void)
775775
{
776776
if (acpi_aml_initialized) {
777777
acpi_unregister_debugger(&acpi_aml_debugger);

drivers/acpi/button.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#define PREFIX "ACPI: "
2525

2626
#define ACPI_BUTTON_CLASS "button"
27-
#define ACPI_BUTTON_FILE_INFO "info"
2827
#define ACPI_BUTTON_FILE_STATE "state"
2928
#define ACPI_BUTTON_TYPE_UNKNOWN 0x00
3029
#define ACPI_BUTTON_NOTIFY_STATUS 0x80

drivers/acpi/cppc_acpi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ static void cppc_chan_tx_done(struct mbox_client *cl, void *msg, int ret)
350350
*(u16 *)msg, ret);
351351
}
352352

353-
struct mbox_client cppc_mbox_cl = {
353+
static struct mbox_client cppc_mbox_cl = {
354354
.tx_done = cppc_chan_tx_done,
355355
.knows_txdone = true,
356356
};
@@ -597,7 +597,7 @@ bool __weak cpc_ffh_supported(void)
597597
*
598598
* Return: 0 for success, errno for failure
599599
*/
600-
int pcc_data_alloc(int pcc_ss_id)
600+
static int pcc_data_alloc(int pcc_ss_id)
601601
{
602602
if (pcc_ss_id < 0 || pcc_ss_id >= MAX_PCC_SUBSPACES)
603603
return -EINVAL;
@@ -846,6 +846,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
846846
"acpi_cppc");
847847
if (ret) {
848848
per_cpu(cpc_desc_ptr, pr->id) = NULL;
849+
kobject_put(&cpc_ptr->kobj);
849850
goto out_free;
850851
}
851852

drivers/acpi/ec.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535
#define ACPI_EC_CLASS "embedded_controller"
3636
#define ACPI_EC_DEVICE_NAME "Embedded Controller"
37-
#define ACPI_EC_FILE_INFO "info"
3837

3938
/* EC status register */
4039
#define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */

drivers/acpi/evged.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ static acpi_status acpi_ged_request_interrupt(struct acpi_resource *ares,
7979
struct resource r;
8080
struct acpi_resource_irq *p = &ares->data.irq;
8181
struct acpi_resource_extended_irq *pext = &ares->data.extended_irq;
82+
char ev_name[5];
83+
u8 trigger;
8284

8385
if (ares->type == ACPI_RESOURCE_TYPE_END_TAG)
8486
return AE_OK;
@@ -87,14 +89,28 @@ static acpi_status acpi_ged_request_interrupt(struct acpi_resource *ares,
8789
dev_err(dev, "unable to parse IRQ resource\n");
8890
return AE_ERROR;
8991
}
90-
if (ares->type == ACPI_RESOURCE_TYPE_IRQ)
92+
if (ares->type == ACPI_RESOURCE_TYPE_IRQ) {
9193
gsi = p->interrupts[0];
92-
else
94+
trigger = p->triggering;
95+
} else {
9396
gsi = pext->interrupts[0];
97+
trigger = pext->triggering;
98+
}
9499

95100
irq = r.start;
96101

97-
if (ACPI_FAILURE(acpi_get_handle(handle, "_EVT", &evt_handle))) {
102+
switch (gsi) {
103+
case 0 ... 255:
104+
sprintf(ev_name, "_%c%02hhX",
105+
trigger == ACPI_EDGE_SENSITIVE ? 'E' : 'L', gsi);
106+
107+
if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))
108+
break;
109+
/* fall through */
110+
default:
111+
if (ACPI_SUCCESS(acpi_get_handle(handle, "_EVT", &evt_handle)))
112+
break;
113+
98114
dev_err(dev, "cannot locate _EVT method\n");
99115
return AE_ERROR;
100116
}

drivers/acpi/pci_link.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
ACPI_MODULE_NAME("pci_link");
3232
#define ACPI_PCI_LINK_CLASS "pci_irq_routing"
3333
#define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link"
34-
#define ACPI_PCI_LINK_FILE_INFO "info"
35-
#define ACPI_PCI_LINK_FILE_STATUS "state"
3634
#define ACPI_PCI_LINK_MAX_POSSIBLE 16
3735

3836
static int acpi_pci_link_add(struct acpi_device *device,

drivers/acpi/power.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
ACPI_MODULE_NAME("power");
3737
#define ACPI_POWER_CLASS "power_resource"
3838
#define ACPI_POWER_DEVICE_NAME "Power Resource"
39-
#define ACPI_POWER_FILE_INFO "info"
40-
#define ACPI_POWER_FILE_STATUS "state"
4139
#define ACPI_POWER_RESOURCE_STATE_OFF 0x00
4240
#define ACPI_POWER_RESOURCE_STATE_ON 0x01
4341
#define ACPI_POWER_RESOURCE_STATE_UNKNOWN 0xFF

drivers/acpi/processor_idle.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
308308
if (ret)
309309
return ret;
310310

311-
/*
312-
* It is expected that there will be at least 2 states, C1 and
313-
* something else (C2 or C3), so fail if that is not the case.
314-
*/
315-
if (pr->power.count < 2)
311+
if (!pr->power.count)
316312
return -EFAULT;
317313

318314
pr->flags.has_cst = 1;
@@ -468,8 +464,7 @@ static int acpi_processor_get_cstate_info(struct acpi_processor *pr)
468464
for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
469465
if (pr->power.states[i].valid) {
470466
pr->power.count = i;
471-
if (pr->power.states[i].type >= ACPI_STATE_C2)
472-
pr->flags.power = 1;
467+
pr->flags.power = 1;
473468
}
474469
}
475470

drivers/acpi/sbs.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
#define ACPI_SBS_CLASS "sbs"
2929
#define ACPI_AC_CLASS "ac_adapter"
3030
#define ACPI_SBS_DEVICE_NAME "Smart Battery System"
31-
#define ACPI_SBS_FILE_INFO "info"
32-
#define ACPI_SBS_FILE_STATE "state"
33-
#define ACPI_SBS_FILE_ALARM "alarm"
3431
#define ACPI_BATTERY_DIR_NAME "BAT%i"
3532
#define ACPI_AC_DIR_NAME "AC0"
3633

drivers/acpi/utils.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,31 @@ acpi_status acpi_evaluate_lck(acpi_handle handle, int lock)
605605
return status;
606606
}
607607

608+
/**
609+
* acpi_evaluate_reg: Evaluate _REG method to register OpRegion presence
610+
* @handle: ACPI device handle
611+
* @space_id: ACPI address space id to register OpRegion presence for
612+
* @function: Parameter to pass to _REG one of ACPI_REG_CONNECT or
613+
* ACPI_REG_DISCONNECT
614+
*
615+
* Evaluate device's _REG method to register OpRegion presence.
616+
*/
617+
acpi_status acpi_evaluate_reg(acpi_handle handle, u8 space_id, u32 function)
618+
{
619+
struct acpi_object_list arg_list;
620+
union acpi_object params[2];
621+
622+
params[0].type = ACPI_TYPE_INTEGER;
623+
params[0].integer.value = space_id;
624+
params[1].type = ACPI_TYPE_INTEGER;
625+
params[1].integer.value = function;
626+
arg_list.count = 2;
627+
arg_list.pointer = params;
628+
629+
return acpi_evaluate_object(handle, "_REG", &arg_list, NULL);
630+
}
631+
EXPORT_SYMBOL(acpi_evaluate_reg);
632+
608633
/**
609634
* acpi_evaluate_dsm - evaluate device's _DSM method
610635
* @handle: ACPI device handle

0 commit comments

Comments
 (0)