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):
ACPI: AC: Remove unnecessary checks
ACPI: AC: Use string_choices API instead of ter
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
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
tform 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: M
being 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/cor
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
ed-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
/
[1]
v3:
- in AC 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)
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
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
tform 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: M
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
being 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/cor
ed-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
-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
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
ck for event installer
v3:
- 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 eve
, 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
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(
s required 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/dr
s required 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/dr
s required 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 fi
s required 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
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
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
s required 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
s required 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/ther
pi/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: Move handler installing logic to driver
acpi/ba
, 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
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(
s required 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/dr
s required 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/dr
s required 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 fi
s required 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/ac
ggested-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
---
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
s required 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 c
- fix compilation errors 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 installin
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(
, 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
s required 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/dr
s required 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/dr
s required 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 fi
ggested-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
---
s required 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/ac
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
s required 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 c
rt of the driver. 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]
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
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
river 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 sol
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
tform 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: M
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
being 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/cor
ed-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
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
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
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
per rollback.
Fixes: 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/driv
60 matches
Mail list logo