summaryrefslogtreecommitdiff
path: root/drivers/acpi
AgeCommit message (Collapse)Author
2026-06-01ACPI: button: Eliminate ternary operator from acpi_lid_evaluate_state()Rafael J. Wysocki
The ternary operator in acpi_lid_evaluate_state() is not actually needed because the same result can be achieved by applying the !! operator to the lid_state value, so update the code accordingly. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3055906.e9J7NaK4W3@rafael.j.wysocki
2026-06-01ACPI: button: Use bool for representing boolean valuesRafael J. Wysocki
Change the data type of the last_state field in struct acpi_button and the data type of the acpi_lid_notify_state() second argument to bool because they both are used for storing boolean values. Update the callers of acpi_lid_notify_state() accordingly and while at it, remove the unnecessary (void) cast from the acpi_lid_update_state() call in acpi_lid_initialize_state() for consistency. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/2274778.irdbgypaU6@rafael.j.wysocki
2026-06-01ACPI: button: Improve warning message regarding lid stateRafael J. Wysocki
The warning message regarding an unexpected lid state printed by acpi_lid_notify_state() is quite cryptic and there is no information in it to indicate that it is about a platform firmware defect. In fact, it can only be understood after reading the comment below the statement printing it. For this reason, replace it with a more direct one including FW_BUG so its connection to a firmware issue is clearer. While at it, fix up a comment preceding the statement printing the message in question. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/5084775.GXAFRqVoOG@rafael.j.wysocki
2026-06-01ACPI: button: Pass ACPI handle to acpi_lid_evaluate_state()Rafael J. Wysocki
Make it clear that acpi_lid_evaluate_state() only uses the ACPI handle of the lid by changing its argument to acpi_handle and adjust its callers accordingly. Also save the ACPI handle of the lid, that later may be passed to acpi_lid_evaluate_state(), in a static variable instead of saving a pointer to the ACPI device object containing that handle. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/4747530.LvFx2qVVIh@rafael.j.wysocki
2026-06-01ACPI: button: Fix lid_device value leak past driver removalRafael J. Wysocki
Static variable lid_device is set when the ACPI button driver probes the last lid device (under the assumptions that there will be only one lid device in the system) and never cleared, but in principle it should be reset when the driver unbinds from the lid device pointed to by it. Address that and add locking that is needed to clear and set that variable safely. Fixes: 7e12715ecc47 ("ACPI button: provide lid status functions") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/6281379.lOV4Wx5bFT@rafael.j.wysocki
2026-06-01spi: fsl-lpspi: fix DMA termination issuesMark Brown
Carlos Song (OSS) <carlos.song@oss.nxp.com> says: This series fixes two issues in the fsl-lpspi DMA transfer error paths. Patch 1 replaces the deprecated dmaengine_terminate_all() with dmaengine_terminate_sync() across all error paths in fsl_lpspi_dma_transfer(). Patch 2 fixes a missing RX DMA channel termination when TX descriptor preparation fails. Since the RX channel is already submitted and issued before the TX descriptor is prepared, returning -EINVAL without terminating the RX channel leaves it running against buffers that the SPI core will unmap, potentially causing memory corruption. Link: https://patch.msgid.link/20260525062357.3191349-1-carlos.song@oss.nxp.com
2026-05-29Merge branch 'acpi-driver-devm'Rafael J. Wysocki
Merge updates that introduce devm_acpi_install_notify_handler() and convert some drivers for core ACPI devices previously using acpi_dev_install_notify_handler() to devres-based resource management. * acpi-driver-devm: ACPI: video: Switch over to devres-based resource management ACPI: video: Use devm for video->entry and backlight cleanup ACPI: video: Use devm action for freeing video devices ACPI: video: Use devm action for video bus object cleanup ACPI: video: Rearrange probe and remove code ACPI: video: Reduce the number of auxiliary device dereferences ACPI: PAD: Switch over to devres-based resource management ACPI: PAD: Fix teardown ordering in acpi_pad_remove() ACPI: PAD: Pass struct device pointer to acpi_pad_notify() ACPI: PAD: Rearrange acpi_pad_notify() ACPI: thermal: Switch over to devres-based resource management ACPI: HED: Switch over to devres-based resource management ACPI: HED: Refine guarding against adding a second instance ACPI: battery: Switch over to devres-based resource management ACPI: AC: Switch over to devres-based resource management ACPI: NFIT: core: Use devm_acpi_install_notify_handler() ACPI: bus: Introduce devm_acpi_install_notify_handler()
2026-05-29Merge branch 'acpi-pmic'Rafael J. Wysocki
Merge an ACPI PMIC driver cleanup for 7.2. * acpi-pmic: ACPI: PMIC: Replace mutex_lock/unlock() with guard()/scoped_guard()
2026-05-29Merge branch 'acpi-video'Rafael J. Wysocki
Merge an ACPI video bus driver cleanup for 7.2. * acpi-video: ACPI: video: Do not initialise device_id_scheme directly
2026-05-29i2c: designware: Add ACPI ID LECA0003 for LECARC SoCsThomas Lin
Add ACPI ID "LECA0003" for LECARC SoCs that integrate the DesignWare I2C controller. Also add corresponding ACPI description in acpi_apd.c. Signed-off-by: Thomas Lin <thomas_lin@lecomputing.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20260526-lecarc-i2c-acpi-id-v1-1-f0942bd491d2@lecomputing.com
2026-05-27ACPICA: add boundary checks in two placesikaros
Add boundary checks in acpi_ps_get_next_namestring() and acpi_ps_peek_opcode() to prevent out-of-bounds access. Link: https://github.com/acpica/acpica/commit/cfdc96896d8d Signed-off-by: ikaros <void0red@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/5180044.0VBMTVartN@rafael.j.wysocki
2026-05-27ACPICA: Add package limit checks in parser functionsikaros
Add package limit checks in parser functions to prevent out-of-bounds access. Link: https://github.com/acpica/acpica/commit/b31b45af2122 Signed-off-by: ikaros <void0red@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3212937.CbtlEUcBR6@rafael.j.wysocki
2026-05-27ACPICA: Update the copyright year to 2026Pawel Chmielewski
Update copyright notices in all ACPICA files. Link: https://github.com/acpica/acpica/commit/9def02549a9c Signed-off-by: Pawel Chmielewski <pawel.chmielewski@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/4379132.1IzOArtZ34@rafael.j.wysocki
2026-05-27ACPICA: Remove spurious precision from format used to dump parse treesDavid Laight
The debug code in acpi_ps_delete_parse_tree() uses ("%*.s", level * 4, " ") to indent traces. POSIX requires the empty precision be treated as zero, but the kernel treats is as 'no precision specified'. Change to ("%*s", level * 4, "") since there is additional whitespace and no reason to indent by one space when level is zero. Link: https://github.com/acpica/acpica/commit/a87038098af6 Signed-off-by: David Laight <david.laight.linux@gmail.com> Signed-off-by: Pawel Chmielewski <pawel.chmielewski@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/2914242.BEx9A2HvPv@rafael.j.wysocki
2026-05-27ACPICA: Enhance OEM ID and Table ID validation in acpi_ex_load_table_op()ikaros
Enhance OEM ID and Table ID validation in acpi_ex_load_table_op() to prevent buffer overflows. Link: https://github.com/acpica/acpica/commit/f85a43098d65 Signed-off-by: ikaros <void0red@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/2230782.OBFZWjSADL@rafael.j.wysocki
2026-05-27ACPICA: Fix NULL pointer dereference in acpi_ns_custom_package()Weiming Shi
acpi_ns_custom_package() unconditionally dereferences the first element of the package to read the _BIX version number, without checking for NULL: if ((*Elements)->Common.Type != ACPI_TYPE_INTEGER) When firmware returns a _BIX package whose first element is an unresolvable reference, ACPICA evaluates that entry to NULL. acpi_ns_remove_null_elements() does not strip NULL entries for ACPI_PTYPE_CUSTOM packages (fixed-position format would break if elements were shifted), so acpi_ns_custom_package() sees the NULL and causes a crash. Add a NULL check for the first element (version field) before dereferencing it. The caller then receives AE_AML_OPERAND_TYPE instead of crashing. Link: https://github.com/acpica/acpica/commit/f3f111b9013b Reported-by: Xiang Mei <xmei5@asu.edu> Reported-by: Weiming Shi <bestswngs@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/5674388.Sb9uPGUboI@rafael.j.wysocki
2026-05-27ACPICA: Enhance buffer validation in acpi_ut_walk_aml_resources()ikaros
Enhance buffer validation in acpi_ut_walk_aml_resources() to prevent buffer overflows. Link: https://github.com/acpica/acpica/commit/975cb20c7992 Signed-off-by: ikaros <void0red@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/2481429.NG923GbCHz@rafael.j.wysocki
2026-05-27ACPICA: Add validation for node in acpi_ns_build_normalized_path()ikaros
Add validation for node in acpi_ns_build_normalized_path() to prevent use-after-free vulnerabilities. Link: https://github.com/acpica/acpica/commit/b35adf49e89a Signed-off-by: ikaros <void0red@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/118666237.nniJfEyVGO@rafael.j.wysocki
2026-05-27ACPICA: validate handler object type in two placesikaros
ACPICA: validate handler object type in acpi_ev_has_default_handler() and acpi_ev_find_region_handler(). Link: https://github.com/acpica/acpica/commit/f6fc648a1389 Signed-off-by: ikaros <void0red@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/48111441.fMDQidcC6G@rafael.j.wysocki
2026-05-27ACPICA: Improve argument parsing in acpi_ps_get_next_simple_arg()ikaros
Improve argument parsing in acpi_ps_get_next_simple_arg() to handle remaining AML data safely. Link: https://github.com/acpica/acpica/commit/ecbb8bcfe301 Signed-off-by: ikaros <void0red@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/2008043.taCxCBeP46@rafael.j.wysocki
2026-05-27ACPICA: Fix integer overflow in acpi_ex_opcode_3A_1T_1R() (mid_op)ikaros
Add overflow check for Index + Length to prevent integer overflow when calculating the truncation length. This prevents negative size parameter being passed to memcpy(). Link: https://github.com/acpica/acpica/commit/d281ec1ac84e Signed-off-by: ikaros <void0red@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3760974.R56niFO833@rafael.j.wysocki
2026-05-27ACPICA: Prevent adding invalid referencesikaros
Prevent adding references for local, argument, and debug objects in acpi_ut_copy_simple_object(). Link: https://github.com/acpica/acpica/commit/f576898d7814 Signed-off-by: ikaros <void0red@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/4511989.ejJDZkT8p0@rafael.j.wysocki
2026-05-27ACPICA: add boundary checks in acpi_ps_get_next_field()ikaros
Add boundary checks in acpi_ps_get_next_field() to prevent out-of-bounds access. Link: https://github.com/acpica/acpica/commit/c39183ea84bc Signed-off-by: ikaros <void0red@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/24388159.6Emhk5qWAg@rafael.j.wysocki
2026-05-27ACPICA: validate byte_count in acpi_ps_get_next_package_length()ikaros
Validate package length reading in acpi_ps_get_next_package_length(). Link: https://github.com/acpica/acpica/commit/40e03f9941e2 Signed-off-by: ikaros <void0red@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3616255.QJadu78ljV@rafael.j.wysocki
2026-05-27ACPICA: Fix use-after-free in acpi_ds_terminate_control_method()ikaros
Fix use-after-free issue in acpi_ds_terminate_control_method() by clearing references to method locals and arguments. Link: https://github.com/acpica/acpica/commit/36f22a94cb1b Signed-off-by: ikaros <void0red@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/8730924.NyiUUSuA9g@rafael.j.wysocki
2026-05-27ACPICA: fix I2C LVR item count in the conversion tableAkhil R
For ACPI_RSC_MOVE8, the 'Value' field in struct acpi_rsconvert_info is the item count count and not a bit position like for the bitflags. Set 'Value' as '1' to fix this. Conversion still works coincidentally with '0' because item_count is not reset between table entries, and the previous count value was taking effect. Link: https://github.com/acpica/acpica/commit/70082dc8fc84 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/6164740.MhkbZ0Pkbq@rafael.j.wysocki
2026-05-27ACPICA: Mention the LVR bitsAkhil R
Add a comment mentioning the LVR byte position in the type_specific_flag. Link: https://github.com/acpica/acpica/commit/014fa9f2dbcc Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/9627007.CDJkKcVGEf@rafael.j.wysocki
2026-05-27ACPICA: Change LVR to 8 bit valueAkhil R
In the LVR I2C resource entry to acpi_rs_convert_i2c_serial_bus[]. Link: https://github.com/acpica/acpica/commit/7650d4a889ea Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3952474.kQq0lBPeGt@rafael.j.wysocki
2026-05-27ACPICA: Fetch LVR I2C resource descriptorAkhil R
Add LVR I2C resource entry to acpi_rs_convert_i2c_serial_bus[]. Link: https://github.com/acpica/acpica/commit/c40411823510 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/23121545.EfDdHjke4D@rafael.j.wysocki
2026-05-27ACPICA: Fix FADT 32/64X length mismatch warningAbdelkader Boudih
When the 64-bit address is set but bit_width is 0, the spec says the legacy length should be used. That is valid firmware. Skip the warning if bit_width is 0. This avoids false warnings like: 32/64X length mismatch in FADT/gpe0_block: 128/0 Tested on free_BSD 16.0-CURRENT. Link: https://github.com/acpica/acpica/commit/b6387a387c51 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/8688362.T7Z3S40VBb@rafael.j.wysocki
2026-05-27ACPICA: Add alias node support in namespace handlingikaros
- Mark nodes as alias in ld_namespace2_begin() function. - Skip teardown for alias nodes in acpi_ns_detach_object() function. - Define ANOBJ_IS_ALIAS flag in aclocal.h. Link: https://github.com/acpica/acpica/commit/cfcc46c4f717 Signed-off-by: ikaros <void0red@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/14020896.uLZWGnKmhe@rafael.j.wysocki
2026-05-27ACPICA: Fix condition check in acpi_ps_parse_loop()ikaros
Fix condition check for AML_ELSE_OP in acpi_ps_parse_loop() to prevent out-of-bounds access. Link: https://github.com/acpica/acpica/commit/3b537b92336e Signed-off-by: ikaros <void0red@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/1959692.tdWV9SEqCh@rafael.j.wysocki
2026-05-27ACPI: video: Do not initialise device_id_scheme directlyJean-Ralph Aviles
Drop the unnecessary initialization of device_id_scheme to false. Signed-off-by: Jean-Ralph Aviles <jeanralph.aviles@gmail.com> [ rjw: Subject and changelog edits ] Link: https://patch.msgid.link/39d1c5567a2c0c6454a0c10a32d2dd853349d303.1778378939.git.jeanralph.aviles@gmail.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-05-25ACPI: video: Switch over to devres-based resource managementRafael J. Wysocki
Turn acpi_video_bus_remove_notify_handler() into a devm action added by acpi_video_bus_probe() after calling acpi_video_bus_add_notify_handler and use the newly introduced devm_acpi_install_notify_handler() to install an ACPI notify handler for the video bus device. This replaces the rollback path remnant in acpi_video_bus_probe() and allows acpi_video_bus_remove() to be dropped altogether. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/2556320.jE0xQCEvom@rafael.j.wysocki
2026-05-25ACPI: video: Use devm for video->entry and backlight cleanupRafael J. Wysocki
Introduce acpi_video_bus_del() for removing the video bus object from the video_bus_head list and unregistering backlight and make acpi_video_bus_probe() add it as a devm action after adding the video bus object to the video_bus_head list. Accordingly, remove the code superseded by it from acpi_video_bus_remove() and from the rollback path in acpi_video_bus_probe(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/2279582.Icojqenx9y@rafael.j.wysocki
2026-05-25ACPI: video: Use devm action for freeing video devicesRafael J. Wysocki
Rename acpi_video_bus_put_devices() to devm_acpi_video_bus_get_devices() and turn acpi_video_bus_put_devices() into a devm action added by it for freeing the video devices allocated by it and the attached_array memory. Accordingly, remove the acpi_video_bus_put_devices() calls and attached_array freeing from acpi_video_bus_remove() and the rollback path in acpi_video_bus_probe(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/1932803.atdPhlSkOF@rafael.j.wysocki
2026-05-25ACPI: video: Use devm action for video bus object cleanupRafael J. Wysocki
Introduce acpi_video_bus_free() for freeing video bus object memory and reversing changes related to it made during ACPI video bus device probe, modify acpi_video_bus_probe() to add acpi_video_bus_free() as a devm action, and remove the code superseded by it from acpi_video_bus_remove(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3892168.MHq7AAxBmi@rafael.j.wysocki
2026-05-25ACPI: video: Rearrange probe and remove codeRafael J. Wysocki
Rearrange some ACPI video bus probe and remove code so that it is more clear that the probe and removal are carried in reverse orders, which will also facilitate subsequent changes. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/2276683.Mh6RI2rZIc@rafael.j.wysocki
2026-05-25ACPI: video: Reduce the number of auxiliary device dereferencesRafael J. Wysocki
Store the &aux_dev->dev pointer in a separate local variable in acpi_video_bus_probe() to avoid dereferencing aux_dev many times. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/2707186.Lt9SDvczpP@rafael.j.wysocki
2026-05-25ACPI: PAD: Switch over to devres-based resource managementRafael J. Wysocki
Use the newly introduced devm_acpi_install_notify_handler() for installing an ACPI notify handler and since that function checks the ACPI companion of the owner device against NULL internally, remove the the explicit ACPI companion check from acpi_pad_probe(). However, to prevent the notify handler from running acpi_pad_idle_cpus() with the number of idle CPUs greater than zero after acpi_pad_remove() has returned, add a bool static variable for synchronization between the two. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/1964581.CQOukoFCf9@rafael.j.wysocki
2026-05-25ACPI: PAD: Fix teardown ordering in acpi_pad_remove()Rafael J. Wysocki
The ACPI notify handler installed by acpi_pad_probe() needs to be removed before calling acpi_pad_idle_cpus() in acpi_pad_remove() so it doesn't schedule idle time injection on some CPUs again. Fixes: 8e0af5141ab9 ("ACPI: create Processor Aggregator Device driver") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/2064153.usQuhbGJ8B@rafael.j.wysocki
2026-05-25ACPI: PAD: Pass struct device pointer to acpi_pad_notify()Rafael J. Wysocki
Use the struct device pointer to the dev member in the struct platform_device object representing the platform device used for driver binding as the last argument of acpi_dev_install_notify_handler() and accordingly update acpi_pad_notify() to pass that pointer directly to dev_name() when generating the netlink event. Since the dev_name() value for an ACPI-enumerated platform device is the same as the dev_name() value for the dev member of its ACPI companion object, as per acpi_create_platform_device(), the above code modification is not expected to cause functionality to change. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/1862521.VLH7GnMWUR@rafael.j.wysocki
2026-05-25ACPI: PAD: Rearrange acpi_pad_notify()Rafael J. Wysocki
Use an if () in acpi_pad_notify() instead of a switch () statement to make the code somewhat easier to follow and reduce its indentation level. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3345485.5fSG56mABF@rafael.j.wysocki
2026-05-25ACPI: thermal: Switch over to devres-based resource managementRafael J. Wysocki
Switch over the ACPI thermal zone driver to devres-based resource management by making the following changes: * Turn acpi_thermal_zone_free() into a devm action added from acpi_thermal_probe() after allocating the struct acpi_thermal object. * Rename acpi_thermal_unregister_thermal_zone() to acpi_thermal_zone_unregister(), add acpi_thermal_pm_queue flushing to it, and turn it into a devm action added by acpi_thermal_probe() after calling acpi_thermal_register_thermal_zone(). * Use the newly introduced devm_acpi_install_notify_handler() for installing an ACPI notify handler. * Drop acpi_thermal_remove() that is not necessary any more. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3698719.iIbC2pHGDl@rafael.j.wysocki
2026-05-25ACPI: HED: Switch over to devres-based resource managementRafael J. Wysocki
Use the newly introduced devm_acpi_install_notify_handler() for installing an ACPI notify handler and since that function checks the ACPI companion of the owner device against NULL internally, remove the the explicit ACPI companion check from acpi_hed_probe(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/7950702.EvYhyI6sBW@rafael.j.wysocki
2026-05-25ACPI: HED: Refine guarding against adding a second instanceRafael J. Wysocki
There can be only one ACPI hardware event device (HED) in use at a time, so acpi_hed_probe() uses static variable hed_handle for guarding against adding a second HED instance, but there is no reason for that variable to hold an ACPI handle, so change it to a bool one. While at it also set that variable at the end of acpi_hed_probe() to avouid the need to clear it when installing the ACPI notify handler fails. Note that ACPI devices are enumerated sequentially, so there's no need for additional locking around the accesses to that variable. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/2042970.PYKUYFuaPT@rafael.j.wysocki
2026-05-25ACPI: battery: Switch over to devres-based resource managementRafael J. Wysocki
The ACPI battery driver already uses devm_kzalloc() for allocating memory and devm_mutex_init() for mutex initialization, but it still carries out some manual rollback in acpi_battery_probe(). Switch it over to devres-based resource management completely by making three changes: * Rename acpi_battery_update_retry() to devm_acpi_battery_update_retry(), turn sysfs_battery_cleanup() into a devm action and modify the former to add it. * Add devm_acpi_battery_init_wakeup() for initializing the wakeup source and make it add a custom devm action to automatically remove the wakeup source registered by it. * Make acpi_battery_probe() use devm_acpi_install_notify_handler() that has just been introduced for installing an ACPI notify handler. Note that the code ordering change related to the last of the above changes does not matter because there is no functional dependency between the PM notifier and the wakeup source or the ACPI notify handler. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/10856906.nUPlyArG6x@rafael.j.wysocki
2026-05-25ACPI: AC: Switch over to devres-based resource managementRafael J. Wysocki
Use devm_kzalloc() for allocating memory, devm_power_supply_register() for registering a power supply class device and the newly introduced devm_acpi_install_notify_handler() for installing an ACPI notify handler. Note that the code ordering change related to the third of the above modifications does not matter because there is no order dependency between the battery notifier and the ACPI notify handler. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3422377.44csPzL39Z@rafael.j.wysocki
2026-05-25ACPI: NFIT: core: Use devm_acpi_install_notify_handler()Rafael J. Wysocki
Now that devm_acpi_install_notify_handler() is available, use it in acpi_nfit_probe() instead of a custom devm action removing an ACPI notify handler installed via acpi_dev_install_notify_handler(). Also drop the explicit ACPI_COMPANION() check against NULL that is not necessary any more becuase devm_acpi_install_notify_handler() carries out an equivalent check internally and use ACPI_HANDLE() to retrieve the platform device's ACPI handle. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3048737.e9J7NaK4W3@rafael.j.wysocki
2026-05-25ACPI: bus: Introduce devm_acpi_install_notify_handler()Rafael J. Wysocki
Introduce devm_acpi_install_notify_handler() for installing an ACPI notify handler managed by devres that will be removed automatically on driver detach. It installs the notify handler on the device object in the ACPI namespace that corresponds to the owner device's ACPI companion, if present (an error is returned if the owner device doesn't have an ACPI companion). Currently, there is no way to manually remove the notify handler installed by it because none of its users brought on subsequently will need to do that. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> [ rjw: Kerneldoc comment refinement ] Link: https://patch.msgid.link/2268031.irdbgypaU6@rafael.j.wysocki Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>