|
40 | 40 | #include <linux/kobject.h> |
41 | 41 | #include <linux/limits.h> |
42 | 42 | #include <linux/module.h> |
43 | | -#include <linux/notifier.h> |
44 | 43 | #include <linux/platform_profile.h> |
45 | 44 | #include <linux/types.h> |
46 | 45 | #include <linux/wmi.h> |
|
49 | 48 | #include "wmi-events.h" |
50 | 49 | #include "wmi-gamezone.h" |
51 | 50 | #include "wmi-helpers.h" |
52 | | -#include "wmi-other.h" |
53 | 51 | #include "../firmware_attributes_class.h" |
54 | 52 |
|
55 | 53 | #define LENOVO_OTHER_MODE_GUID "DC2A8805-3A8C-41BA-A6F7-092E0089CD3B" |
|
81 | 79 | #define LWMI_OM_FW_ATTR_BASE_PATH "lenovo-wmi-other" |
82 | 80 | #define LWMI_OM_HWMON_NAME "lenovo_wmi_other" |
83 | 81 |
|
84 | | -static BLOCKING_NOTIFIER_HEAD(om_chain_head); |
85 | 82 | static DEFINE_IDA(lwmi_om_ida); |
86 | 83 |
|
87 | 84 | enum attribute_property { |
@@ -109,7 +106,6 @@ struct lwmi_om_priv { |
109 | 106 | struct device *hwmon_dev; |
110 | 107 | struct device *fw_attr_dev; |
111 | 108 | struct kset *fw_attr_kset; |
112 | | - struct notifier_block nb; |
113 | 109 | struct wmi_device *wdev; |
114 | 110 | int ida_id; |
115 | 111 |
|
@@ -577,102 +573,6 @@ struct capdata01_attr_group { |
577 | 573 | struct tunable_attr_01 *tunable_attr; |
578 | 574 | }; |
579 | 575 |
|
580 | | -/** |
581 | | - * lwmi_om_register_notifier() - Add a notifier to the blocking notifier chain |
582 | | - * @nb: The notifier_block struct to register |
583 | | - * |
584 | | - * Call blocking_notifier_chain_register to register the notifier block to the |
585 | | - * lenovo-wmi-other driver notifier chain. |
586 | | - * |
587 | | - * Return: 0 on success, %-EEXIST on error. |
588 | | - */ |
589 | | -int lwmi_om_register_notifier(struct notifier_block *nb) |
590 | | -{ |
591 | | - return blocking_notifier_chain_register(&om_chain_head, nb); |
592 | | -} |
593 | | -EXPORT_SYMBOL_NS_GPL(lwmi_om_register_notifier, "LENOVO_WMI_OTHER"); |
594 | | - |
595 | | -/** |
596 | | - * lwmi_om_unregister_notifier() - Remove a notifier from the blocking notifier |
597 | | - * chain. |
598 | | - * @nb: The notifier_block struct to register |
599 | | - * |
600 | | - * Call blocking_notifier_chain_unregister to unregister the notifier block from the |
601 | | - * lenovo-wmi-other driver notifier chain. |
602 | | - * |
603 | | - * Return: 0 on success, %-ENOENT on error. |
604 | | - */ |
605 | | -int lwmi_om_unregister_notifier(struct notifier_block *nb) |
606 | | -{ |
607 | | - return blocking_notifier_chain_unregister(&om_chain_head, nb); |
608 | | -} |
609 | | -EXPORT_SYMBOL_NS_GPL(lwmi_om_unregister_notifier, "LENOVO_WMI_OTHER"); |
610 | | - |
611 | | -/** |
612 | | - * devm_lwmi_om_unregister_notifier() - Remove a notifier from the blocking |
613 | | - * notifier chain. |
614 | | - * @data: Void pointer to the notifier_block struct to register. |
615 | | - * |
616 | | - * Call lwmi_om_unregister_notifier to unregister the notifier block from the |
617 | | - * lenovo-wmi-other driver notifier chain. |
618 | | - * |
619 | | - * Return: 0 on success, %-ENOENT on error. |
620 | | - */ |
621 | | -static void devm_lwmi_om_unregister_notifier(void *data) |
622 | | -{ |
623 | | - struct notifier_block *nb = data; |
624 | | - |
625 | | - lwmi_om_unregister_notifier(nb); |
626 | | -} |
627 | | - |
628 | | -/** |
629 | | - * devm_lwmi_om_register_notifier() - Add a notifier to the blocking notifier |
630 | | - * chain. |
631 | | - * @dev: The parent device of the notifier_block struct. |
632 | | - * @nb: The notifier_block struct to register |
633 | | - * |
634 | | - * Call lwmi_om_register_notifier to register the notifier block to the |
635 | | - * lenovo-wmi-other driver notifier chain. Then add devm_lwmi_om_unregister_notifier |
636 | | - * as a device managed action to automatically unregister the notifier block |
637 | | - * upon parent device removal. |
638 | | - * |
639 | | - * Return: 0 on success, or an error code. |
640 | | - */ |
641 | | -int devm_lwmi_om_register_notifier(struct device *dev, |
642 | | - struct notifier_block *nb) |
643 | | -{ |
644 | | - int ret; |
645 | | - |
646 | | - ret = lwmi_om_register_notifier(nb); |
647 | | - if (ret < 0) |
648 | | - return ret; |
649 | | - |
650 | | - return devm_add_action_or_reset(dev, devm_lwmi_om_unregister_notifier, |
651 | | - nb); |
652 | | -} |
653 | | -EXPORT_SYMBOL_NS_GPL(devm_lwmi_om_register_notifier, "LENOVO_WMI_OTHER"); |
654 | | - |
655 | | -/** |
656 | | - * lwmi_om_notifier_call() - Call functions for the notifier call chain. |
657 | | - * @mode: Pointer to a thermal mode enum to retrieve the data from. |
658 | | - * |
659 | | - * Call blocking_notifier_call_chain to retrieve the thermal mode from the |
660 | | - * lenovo-wmi-gamezone driver. |
661 | | - * |
662 | | - * Return: 0 on success, or an error code. |
663 | | - */ |
664 | | -static int lwmi_om_notifier_call(enum thermal_mode *mode) |
665 | | -{ |
666 | | - int ret; |
667 | | - |
668 | | - ret = blocking_notifier_call_chain(&om_chain_head, |
669 | | - LWMI_GZ_GET_THERMAL_MODE, &mode); |
670 | | - if ((ret & ~NOTIFY_STOP_MASK) != NOTIFY_OK) |
671 | | - return -EINVAL; |
672 | | - |
673 | | - return 0; |
674 | | -} |
675 | | - |
676 | 576 | /* Attribute Methods */ |
677 | 577 |
|
678 | 578 | /** |
@@ -780,7 +680,7 @@ static ssize_t attr_current_value_store(struct kobject *kobj, |
780 | 680 | u32 value; |
781 | 681 | int ret; |
782 | 682 |
|
783 | | - ret = lwmi_om_notifier_call(&mode); |
| 683 | + ret = lwmi_tm_notifier_call(&mode); |
784 | 684 | if (ret) |
785 | 685 | return ret; |
786 | 686 |
|
@@ -843,7 +743,7 @@ static ssize_t attr_current_value_show(struct kobject *kobj, |
843 | 743 | int retval; |
844 | 744 | int ret; |
845 | 745 |
|
846 | | - ret = lwmi_om_notifier_call(&mode); |
| 746 | + ret = lwmi_tm_notifier_call(&mode); |
847 | 747 | if (ret) |
848 | 748 | return ret; |
849 | 749 |
|
|
0 commit comments