[PATCH v3] ACPI: NFIT: Use cleanup.h helpers instead of devm_*()

2023-10-17 Thread Michal Wilczynski
efficiently. There is no end user visible side effects of this patch, I was motivated to send this cleanup to practice using the new helpers. Suggested-by: Dave Jiang Suggested-by: Andy Shevchenko Reviewed-by: Dave Jiang Reviewed-by: Andy Shevchenko Signed-off-by: Michal Wilczynski --- Dan, would

[PATCH v2] ACPI: NFIT: Fix local use of devm_*()

2023-10-13 Thread Michal Wilczynski
-by: Dave Jiang Reviewed-by: Andy Shevchenko Signed-off-by: Michal Wilczynski --- v2: - removed first commit from the patchset, as the commit couldn't be marked as a fix - squashed those commits together, since the second one were mostly overwriting the previous one drivers/acpi/nfit

[PATCH v3 6/6] ACPI: NFIT: Remove redundant call to to_acpi_dev()

2023-10-11 Thread Michal Wilczynski
-by: Andy Shevchenko Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 6b9d10cae92c..402bb56d4163 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit

[PATCH v3 5/6] ACPI: NFIT: Replace acpi_driver with platform_driver

2023-10-11 Thread Michal Wilczynski
created during the enumeration, and destroyed on platform device removal. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 34 ++ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/drivers/acpi/nfit/core.c b

[PATCH v3 4/6] ACPI: AC: Rename ACPI device from device to adev

2023-10-11 Thread Michal Wilczynski
is called pdev. Signed-off-by: Michal Wilczynski --- drivers/acpi/ac.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 1dd4919be7ac..2618a7ccc11c 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c @@ -121,11

[PATCH v3 3/6] ACPI: AC: Replace acpi_driver with platform_driver

2023-10-11 Thread Michal Wilczynski
devices instances pdev to make a distinction with ACPI devices instances. Drop unnecessary casts from acpi_bus_generate_netlink_event() and acpi_notifier_call_chain(). Add a blank line to distinguish pdev API vs local ACPI notify function. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal

[PATCH v3 1/6] ACPI: AC: Remove unnecessary checks

2023-10-11 Thread Michal Wilczynski
Remove unnecessary checks for NULL for variables that can't be NULL at the point they're checked for it. Defensive programming is discouraged in the kernel. Signed-off-by: Michal Wilczynski --- drivers/acpi/ac.c | 27 --- 1 file changed, 4 insertions(+), 23 deletions

[PATCH v3 2/6] ACPI: AC: Use string_choices API instead of ternary operator

2023-10-11 Thread Michal Wilczynski
Use modern string_choices API instead of manually determining the output using ternary operator. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Michal Wilczynski --- drivers/acpi/ac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v3 0/6] Replace acpi_driver with platform_driver

2023-10-11 Thread Michal Wilczynski
transformation patch replaced struct device* with struct acpi_device*, as suggested. v2: - dropped first, second and last commit. Last commit was deemed pointless, first and second are already merged. - rebased on top of modified first commit (changes in the wrappers) Michal Wilczynski (6

[PATCH v2 6/6] ACPI: NFIT: Remove redundant call to to_acpi_dev()

2023-10-06 Thread Michal Wilczynski
-by: Andy Shevchenko Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index fb0bc16fa186..3d254b2cf2e7 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit

[PATCH v2 4/6] ACPI: AC: Rename ACPI device from device to adev

2023-10-06 Thread Michal Wilczynski
is called pdev. Signed-off-by: Michal Wilczynski --- 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

[PATCH v2 5/6] ACPI: NFIT: Replace acpi_driver with platform_driver

2023-10-06 Thread Michal Wilczynski
created during the enumeration, and destroyed on platform device removal. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 34 ++ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/drivers/acpi/nfit/core.c b

[PATCH v2 3/6] ACPI: AC: Replace acpi_driver with platform_driver

2023-10-06 Thread Michal Wilczynski
devices instances pdev to make a distinction with ACPI devices instances. Drop unnecessary casts from acpi_bus_generate_netlink_event() and acpi_notifier_call_chain(). Add a blank line to distinguish pdev API vs local ACPI notify function. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal

[PATCH v2 2/6] ACPI: AC: Use string_choices API instead of ternary operator

2023-10-06 Thread Michal Wilczynski
Use modern string_choices API instead of manually determining the output using ternary operator. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Michal Wilczynski --- drivers/acpi/ac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v2 1/6] ACPI: AC: Remove unnecessary checks

2023-10-06 Thread Michal Wilczynski
Remove unnecessary checks for NULL for variables that can't be NULL at the point they're checked for it. Defensive programming is discouraged in the kernel. Signed-off-by: Michal Wilczynski --- drivers/acpi/ac.c | 27 --- 1 file changed, 4 insertions(+), 23 deletions

[PATCH v2 0/6] Replace acpi_driver with platform_driver

2023-10-06 Thread Michal Wilczynski
, second and last commit. Last commit was deemed pointless, first and second are already merged. - rebased on top of modified first commit (changes in the wrappers) Michal Wilczynski (6): ACPI: AC: Remove unnecessary checks ACPI: AC: Use string_choices API instead of ternary operator ACPI

[PATCH v1 1/2] ACPI: NFIT: Fix memory leak, and local use of devm_*()

2023-09-26 Thread Michal Wilczynski
: eaf961536e16 ("libnvdimm, nfit: add interleave-set state-tracking infrastructure") Reported-by: Andy Shevchenko Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/acpi/nfit/core.c

[PATCH v1 2/2] ACPI: NFIT: Use modern scope based rollback

2023-09-26 Thread Michal Wilczynski
Change rollback in acpi_nfit_init_interleave_set() to use modern scope based attribute __free(). This is similar to C++ RAII and is a preferred way for handling local memory allocations. Suggested-by: Dave Jiang Suggested-by: Andy Shevchenko Signed-off-by: Michal Wilczynski --- drivers/acpi

[PATCH v1 0/2] Fix memory leak and move to modern scope based rollback

2023-09-26 Thread Michal Wilczynski
based, similar to C++ RAII [1]. Link: https://lwn.net/Articles/934679/ [1] Michal Wilczynski (2): ACPI: NFIT: Fix memory leak, and local use of devm_*() ACPI: NFIT: Use modern scope based rollback drivers/acpi/nfit/core.c | 21 - 1 file changed, 8 insertions(+), 13

[PATCH v1 9/9] ACPI: NFIT: Don't use KBUILD_MODNAME for driver name

2023-09-25 Thread Michal Wilczynski
Driver name is part of the ABI, so it should be hard-coded, as ABI should be always kept backward compatible. Prevent ABI from changing accidentally in case KBUILD_MODNAME change. Suggested-by: Andy Shevchenko Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 2 +- 1 file changed

[PATCH v1 8/9] ACPI: NFIT: Remove redundant call to to_acpi_dev()

2023-09-25 Thread Michal Wilczynski
-by: Andy Shevchenko Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 2e50b1334a69..f09530d2520a 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit

[PATCH v1 7/9] ACPI: NFIT: Replace acpi_driver with platform_driver

2023-09-25 Thread Michal Wilczynski
created during the enumeration, and destroyed on platform device removal. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 34 ++ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/drivers/acpi/nfit/core.c b

[PATCH v1 6/9] ACPI: AC: Rename ACPI device from device to adev

2023-09-25 Thread Michal Wilczynski
is called pdev. Signed-off-by: Michal Wilczynski --- 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 78e53d0fdece..270a6919ec12 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c @@ -120,7 +120,7

[PATCH v1 5/9] ACPI: AC: Replace acpi_driver with platform_driver

2023-09-25 Thread Michal Wilczynski
devices instances pdev to make a distinction with ACPI devices instances. Drop unnecessary casts from acpi_bus_generate_netlink_event() and acpi_notifier_call_chain(). Add a blank line to distinguish pdev API vs local ACPI notify function. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal

[PATCH v1 4/9] ACPI: AC: Use string_choices API instead of ternary operator

2023-09-25 Thread Michal Wilczynski
Use modern string_choices API instead of manually determining the output using ternary operator. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Michal Wilczynski --- drivers/acpi/ac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v1 1/9] ACPI: bus: Make notify wrappers more generic

2023-09-25 Thread Michal Wilczynski
code we mostly want to use driver data of platform device instead of ACPI device. Make notify handlers installer wrappers more generic, while still saving some code that would be duplicated otherwise. Reviewed-by: Andy Shevchenko Signed-off-by: Michal Wilczynski --- Notes: So one solution

[PATCH v1 3/9] ACPI: AC: Remove unnecessary checks

2023-09-25 Thread Michal Wilczynski
Remove unnecessary checks for NULL for variables that can't be NULL at the point they're checked for it. Defensive programming is discouraged in the kernel. Signed-off-by: Michal Wilczynski --- drivers/acpi/ac.c | 27 --- 1 file changed, 4 insertions(+), 23 deletions

[PATCH v1 2/9] docs: firmware-guide: ACPI: Clarify ACPI bus concepts

2023-09-25 Thread Michal Wilczynski
device and ACPI entries. Suggested-by: Elena Reshetova Signed-off-by: Michal Wilczynski --- Documentation/firmware-guide/acpi/enumeration.rst | 13 + 1 file changed, 13 insertions(+) diff --git a/Documentation/firmware-guide/acpi/enumeration.rst b/Documentation/firmware-guide/acpi

[PATCH v1 0/9] Replace acpi_driver with platform_driver

2023-09-25 Thread Michal Wilczynski
. In that case it makes much more sense to pass this structure to notify handler. Additionally some drivers, like acpi_video that already have custom notify handlers do that already. Link: https://lore.kernel.org/linux-acpi/20230703080252.2899090-1-michal.wilczyn...@intel.com/ [1] Michal Wilczynski (9

[PATCH v7 9/9] acpi/thermal: Move handler installing logic to driver

2023-07-03 Thread Michal Wilczynski
by acpi_dev_install_notify_handler(). Remove .notify callback initialization in acpi_driver. While at it, fix whitespaces in .remove() callback. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/thermal.c | 25 - 1 file changed, 20

[PATCH v7 8/9] acpi/nfit: Remove unnecessary .remove callback

2023-07-03 Thread Michal Wilczynski
Nfit driver doesn't use .remove() callback and provide an empty function as it's .remove() callback. Remove empty acpi_nfit_remove() and initialization of callback. Suggested-by: Dan Williams Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 6 -- 1 file changed, 6 deletions

[PATCH v7 7/9] acpi/nfit: Move handler installing logic to driver

2023-07-03 Thread Michal Wilczynski
-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 41 +++- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 07204d482968..124e928647d3 100644 --- a/drivers

[PATCH v7 6/9] acpi/hed: Move handler installing logic to driver

2023-07-03 Thread Michal Wilczynski
by acpi_dev_install_notify_handler(). Remove .notify callback initialization in acpi_driver. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/hed.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/hed.c b

[PATCH v7 5/9] acpi/battery: Move handler installing logic to driver

2023-07-03 Thread Michal Wilczynski
by acpi_dev_install_notify_handler(). Remove .notify callback initialization in acpi_driver. While at it, fix lack of whitespaces in .remove() callback. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/battery.c | 26 +- 1 file changed

[PATCH v7 4/9] acpi/video: Move handler installing logic to driver

2023-07-03 Thread Michal Wilczynski
by acpi_dev_install_notify_handler(). Remove .notify callback initialization in acpi_driver. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/acpi_video.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/acpi

[PATCH v7 3/9] acpi/ac: Move handler installing logic to driver

2023-07-03 Thread Michal Wilczynski
by acpi_dev_install_notify_handler(). Remove .notify callback initialization in acpi_driver. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/ac.c | 29 + 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/drivers/acpi

[PATCH v7 1/9] acpi/bus: Introduce wrappers for ACPICA event handler install/remove

2023-07-03 Thread Michal Wilczynski
, and export symbols. This will allow the drivers to call them directly, instead of relying on .notify callback. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/bus.c | 26 ++ include/acpi/acpi_bus.h | 6 ++ 2 files changed, 32

[PATCH v7 2/9] acpi/bus: Set driver_data to NULL every time .add() fails

2023-07-03 Thread Michal Wilczynski
Most drivers set driver_data during .add() callback, but usually they don't set it back to NULL in case of a failure. Set driver_data to NULL in acpi_device_probe() to avoid code duplication. Signed-off-by: Michal Wilczynski --- drivers/acpi/bus.c | 4 +++- 1 file changed, 3 insertions(+), 1

[PATCH v7 0/9] Remove .notify callback in acpi_device_ops

2023-07-03 Thread Michal Wilczynski
for drivers [1]: https://lore.kernel.org/linux-acpi/1847933.atdPhlSkOF@kreacher/ Michal Wilczynski (9): acpi/bus: Introduce wrappers for ACPICA event handler install/remove acpi/bus: Set driver_data to NULL every time .add() fails acpi/ac: Move handler installing logic to driver acpi/video

[PATCH v6 9/9] acpi/thermal: Move handler installing logic to driver

2023-06-30 Thread Michal Wilczynski
by acpi_dev_install_notify_handler(). Remove .notify callback initialization in acpi_driver. While at it, fix whitespaces in .remove() callback. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/thermal.c | 25 - 1 file changed, 20

[PATCH v6 8/9] acpi/nfit: Remove unnecessary .remove callback

2023-06-30 Thread Michal Wilczynski
Nfit driver doesn't use .remove() callback and provide an empty function as it's .remove() callback. Remove empty acpi_nfit_remove() and initialization of callback. Suggested-by: Dan Williams Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 6 -- 1 file changed, 6 deletions

[PATCH v6 7/9] acpi/nfit: Move handler installing logic to driver

2023-06-30 Thread Michal Wilczynski
-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 41 +++- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 07204d482968..ee2365a80aa1 100644 --- a/drivers

[PATCH v6 6/9] acpi/hed: Move handler installing logic to driver

2023-06-30 Thread Michal Wilczynski
by acpi_dev_install_notify_handler(). Remove .notify callback initialization in acpi_driver. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/hed.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/hed.c b

[PATCH v6 5/9] acpi/battery: Move handler installing logic to driver

2023-06-30 Thread Michal Wilczynski
by acpi_dev_install_notify_handler(). Remove .notify callback initialization in acpi_driver. While at it, fix lack of whitespaces in .remove() callback. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/battery.c | 26 +- 1 file changed

[PATCH v6 4/9] acpi/video: Move handler installing logic to driver

2023-06-30 Thread Michal Wilczynski
by acpi_dev_install_notify_handler(). Remove .notify callback initialization in acpi_driver. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/acpi_video.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/acpi

[PATCH v6 3/9] acpi/ac: Move handler installing logic to driver

2023-06-30 Thread Michal Wilczynski
by acpi_dev_install_notify_handler(). Remove .notify callback initialization in acpi_driver. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/ac.c | 29 + 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/drivers/acpi

[PATCH v6 2/9] acpi/bus: Set driver_data to NULL every time .add() fails

2023-06-30 Thread Michal Wilczynski
Most drivers set driver_data during .add() callback, but usually they don't set it back to NULL in case of a failure. Set driver_data to NULL in acpi_device_probe() to avoid code duplication. Signed-off-by: Michal Wilczynski --- drivers/acpi/bus.c | 4 +++- 1 file changed, 3 insertions(+), 1

[PATCH v6 1/9] acpi/bus: Introduce wrappers for ACPICA event handler install/remove

2023-06-30 Thread Michal Wilczynski
, and export symbols. This will allow the drivers to call them directly, instead of relying on .notify callback. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/bus.c | 26 ++ include/acpi/acpi_bus.h | 6 ++ 2 files changed, 32

[PATCH v6 0/9] Remove .notify callback in acpi_device_ops

2023-06-30 Thread Michal Wilczynski
/ Michal Wilczynski (9): acpi/bus: Introduce wrappers for ACPICA event handler install/remove acpi/bus: Set driver_data to NULL every time .add() fails acpi/ac: Move handler installing logic to driver acpi/video: Move handler installing logic to driver acpi/battery: Move handler installing

[PATCH v5 10/10] acpi/thermal: Move handler installing logic to driver

2023-06-16 Thread Michal Wilczynski
by acpi_install_notify_handler(). Remove .notify callback initialization in acpi_driver. While at it, fix whitespaces in .remove() callback and move tz assignment upwards. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/thermal.c | 28

[PATCH v5 09/10] acpi/nfit: Move handler installing logic to driver

2023-06-16 Thread Michal Wilczynski
by acpi_install_notify_handler(). Remove .notify callback initialization in acpi_driver. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/nfit

[PATCH v5 08/10] acpi/nfit: Improve terminator line in acpi_nfit_ids

2023-06-16 Thread Michal Wilczynski
Currently terminator line contains redunant characters. Remove them and also remove a comma at the end. Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index

[PATCH v5 07/10] acpi/nfit: Move acpi_nfit_notify() before acpi_nfit_add()

2023-06-16 Thread Michal Wilczynski
To use new style of installing event handlers acpi_nfit_notify() needs to be known inside acpi_nfit_add(). Move acpi_nfit_notify() upwards in the file, so it can be used inside acpi_nfit_add(). Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 14 +++--- 1 file changed, 7

[PATCH v5 06/10] acpi/hed: Move handler installing logic to driver

2023-06-16 Thread Michal Wilczynski
by acpi_install_notify_handler(). Remove .notify callback initialization in acpi_driver. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/hed.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/hed.c b/drivers

[PATCH v5 05/10] acpi/battery: Move handler installing logic to driver

2023-06-16 Thread Michal Wilczynski
by acpi_install_notify_handler(). Remove .notify callback initialization in acpi_driver. While at it, fix lack of whitespaces in .remove() callback. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/battery.c | 30 -- 1 file changed

[PATCH v5 04/10] acpi/video: Move handler installing logic to driver

2023-06-16 Thread Michal Wilczynski
by acpi_install_notify_handler(). Remove .notify callback initialization in acpi_driver. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/acpi_video.c | 26 ++ 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/drivers/acpi

[PATCH v5 03/10] acpi/ac: Move handler installing logic to driver

2023-06-16 Thread Michal Wilczynski
by acpi_install_notify_handler(). Remove .notify callback initialization in acpi_driver. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/ac.c | 33 - 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/drivers/acpi

[PATCH v5 02/10] acpi/bus: Set driver_data to NULL every time .add() fails

2023-06-16 Thread Michal Wilczynski
Most drivers set driver_data during .add() callback, but usually they don't set it back to NULL in case of a failure. Set driver_data to NULL in acpi_device_probe() to avoid code duplication. Signed-off-by: Michal Wilczynski --- drivers/acpi/bus.c | 4 +++- 1 file changed, 3 insertions(+), 1

[PATCH v5 01/10] acpi/bus: Introduce wrappers for ACPICA event handler install/remove

2023-06-16 Thread Michal Wilczynski
, and export symbols. This will allow the drivers to call them directly, instead of relying on .notify callback. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski --- drivers/acpi/bus.c | 26 ++ include/acpi/acpi_bus.h | 6 ++ 2 files changed, 32

[PATCH v5 00/10] Remove .notify callback in acpi_device_ops

2023-06-16 Thread Michal Wilczynski
: - lkp still reported some failures for eeepc, fujitsu and toshiba_bluetooth, fix those v2: - fix compilation errors for drivers [1]: https://lore.kernel.org/linux-acpi/1847933.atdPhlSkOF@kreacher/ Michal Wilczynski (10): acpi/bus: Introduce wrappers for ACPICA event handler install/remove