]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branches 'acpi-scan', 'acpi-tables', 'acpi-ec' and 'acpi-assorted'
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 25 Oct 2015 21:54:46 +0000 (22:54 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 25 Oct 2015 21:54:46 +0000 (22:54 +0100)
* acpi-scan:
  ACPI / scan: use kstrdup_const() in acpi_add_id()
  ACPI / scan: constify struct acpi_hardware_id::id
  ACPI / scan: constify first argument of struct acpi_scan_handler::match

* acpi-tables:
  ACPI / tables: test the correct variable
  x86, ACPI: Handle apic/x2apic entries in MADT in correct order
  ACPI / tables: Add acpi_subtable_proc to ACPI table parsers

* acpi-ec:
  ACPI / EC: Fix a race issue in acpi_ec_guard_event()
  ACPI / EC: Fix query handler related issues

* acpi-assorted:
  ACPI: change acpi_sleep_proc_init() to return void
  ACPI: change init_acpi_device_notify() to return void

1  2  3  4  5 
drivers/acpi/scan.c
include/acpi/acpi_bus.h
include/linux/acpi.h

diff --combined drivers/acpi/scan.c
index d1ce377db3e94e95d239eb9a2d5e8c4b1230757e,afaac47eefb41cb95ff70d2327db00e988332632,01136b8790381ccff5afc259e47643c338914740,01136b8790381ccff5afc259e47643c338914740,01136b8790381ccff5afc259e47643c338914740..f834b8c6d8d1e9c34b063095069bc7ce743d16f0
@@@@@@ -695,6 -695,26 -695,26 -695,26 -695,26 +695,6 @@@@@@ int acpi_device_add(struct acpi_device 
        return result;
     }
     
 ----struct acpi_device *acpi_get_next_child(struct device *dev,
 ----                                   struct acpi_device *child)
 ----{
 ----   struct acpi_device *adev = ACPI_COMPANION(dev);
 ----   struct list_head *head, *next;
 ----
 ----   if (!adev)
 ----           return NULL;
 ----
 ----   head = &adev->children;
 ----   if (list_empty(head))
 ----           return NULL;
 ----
 ----   if (!child)
 ----           return list_first_entry(head, struct acpi_device, node);
 ----
 ----   next = child->node.next;
 ----   return next == head ? NULL : list_entry(next, struct acpi_device, node);
 ----}
 ----
     /* --------------------------------------------------------------------------
                                      Device Enumeration
        -------------------------------------------------------------------------- */
@@@@@@ -1164,7 -1184,7 -1184,7 -1184,7 -1184,7 +1164,7 @@@@@@ static void acpi_add_id(struct acpi_dev
        if (!id)
                return;
     
- ---   id->id = kstrdup(dev_id, GFP_KERNEL);
+ +++   id->id = kstrdup_const(dev_id, GFP_KERNEL);
        if (!id->id) {
                kfree(id);
                return;
@@@@@@ -1302,7 -1322,7 -1322,7 -1322,7 -1322,7 +1302,7 @@@@@@ void acpi_free_pnp_ids(struct acpi_devi
        struct acpi_hardware_id *id, *tmp;
     
        list_for_each_entry_safe(id, tmp, &pnp->ids, list) {
- ---           kfree(id->id);
+ +++           kfree_const(id->id);
                kfree(id);
        }
        kfree(pnp->unique_id);
@@@@@@ -1452,7 -1472,7 -1472,7 -1472,7 -1472,7 +1452,7 @@@@@@ bool acpi_device_is_present(struct acpi
     }
     
     static bool acpi_scan_handler_matching(struct acpi_scan_handler *handler,
- ---                                  char *idstr,
+ +++                                  const char *idstr,
                                       const struct acpi_device_id **matchid)
     {
        const struct acpi_device_id *devid;
        return false;
     }
     
- ---static struct acpi_scan_handler *acpi_scan_match_handler(char *idstr,
+ +++static struct acpi_scan_handler *acpi_scan_match_handler(const char *idstr,
                                        const struct acpi_device_id **matchid)
     {
        struct acpi_scan_handler *handler;
diff --combined include/acpi/acpi_bus.h
index e234725eadc76a7caaecad5121a24cdd5f7d1978,fec002919b65f1067d44c5ce5cf46ac6d9e40a58,5ba8fb64f664ecea523f21034ad3c8f7d3a47e13,5ba8fb64f664ecea523f21034ad3c8f7d3a47e13,5ba8fb64f664ecea523f21034ad3c8f7d3a47e13..d11eff8a4efe95f92d8e75a18498017709ca096f
@@@@@@ -129,7 -129,7 -129,7 -129,7 -129,7 +129,7 @@@@@@ static inline struct acpi_hotplug_profi
     struct acpi_scan_handler {
        const struct acpi_device_id *ids;
        struct list_head list_node;
- ---   bool (*match)(char *idstr, const struct acpi_device_id **matchid);
+ +++   bool (*match)(const char *idstr, const struct acpi_device_id **matchid);
        int (*attach)(struct acpi_device *dev, const struct acpi_device_id *id);
        void (*detach)(struct acpi_device *dev);
        void (*bind)(struct device *phys_dev);
@@@@@@ -227,7 -227,7 -227,7 -227,7 -227,7 +227,7 @@@@@@ typedef char acpi_device_class[20]
     
     struct acpi_hardware_id {
        struct list_head list;
- ---   char *id;
+ +++   const char *id;
     };
     
     struct acpi_pnp_type {
@@@@@@ -343,7 -343,6 -343,6 -343,6 -343,6 +343,7 @@@@@@ struct acpi_device_data 
        const union acpi_object *pointer;
        const union acpi_object *properties;
        const union acpi_object *of_compatible;
 ++++   struct list_head subnodes;
     };
     
     struct acpi_gpio_mapping;
@@@@@@ -379,17 -378,6 -378,6 -378,6 -378,6 +379,17 @@@@@@ struct acpi_device 
        void (*remove)(struct acpi_device *);
     };
     
 ++++/* Non-device subnode */
 ++++struct acpi_data_node {
 ++++   const char *name;
 ++++   acpi_handle handle;
 ++++   struct fwnode_handle fwnode;
 ++++   struct acpi_device_data data;
 ++++   struct list_head sibling;
 ++++   struct kobject kobj;
 ++++   struct completion kobj_done;
 ++++};
 ++++
     static inline bool acpi_check_dma(struct acpi_device *adev, bool *coherent)
     {
        bool ret = false;
     }
     
     static inline bool is_acpi_node(struct fwnode_handle *fwnode)
 ++++{
 ++++   return fwnode && (fwnode->type == FWNODE_ACPI
 ++++           || fwnode->type == FWNODE_ACPI_DATA);
 ++++}
 ++++
 ++++static inline bool is_acpi_device_node(struct fwnode_handle *fwnode)
     {
        return fwnode && fwnode->type == FWNODE_ACPI;
     }
     
 ----static inline struct acpi_device *to_acpi_node(struct fwnode_handle *fwnode)
 ++++static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
     {
 ----   return is_acpi_node(fwnode) ?
 ++++   return is_acpi_device_node(fwnode) ?
                container_of(fwnode, struct acpi_device, fwnode) : NULL;
     }
     
 ++++static inline bool is_acpi_data_node(struct fwnode_handle *fwnode)
 ++++{
 ++++   return fwnode && fwnode->type == FWNODE_ACPI_DATA;
 ++++}
 ++++
 ++++static inline struct acpi_data_node *to_acpi_data_node(struct fwnode_handle *fwnode)
 ++++{
 ++++   return is_acpi_data_node(fwnode) ?
 ++++           container_of(fwnode, struct acpi_data_node, fwnode) : NULL;
 ++++}
 ++++
     static inline struct fwnode_handle *acpi_fwnode_handle(struct acpi_device *adev)
     {
        return &adev->fwnode;
diff --combined include/linux/acpi.h
index 496265b0f52755b0acc6bf2781f2a1961cd0bbb4,7235c4851460e6dc79d6d95a53d368b8f06e3525,b0299f8db660717b4f1318cab1d24c7cb3a33ba1,7235c4851460e6dc79d6d95a53d368b8f06e3525,7235c4851460e6dc79d6d95a53d368b8f06e3525..84e7055bd904dfad3e3ead0842916639cfa6503e
@@@@@@ -49,7 -49,7 -49,7 -49,7 -49,7 +49,7 @@@@@@ static inline acpi_handle acpi_device_h
        return adev ? adev->handle : NULL;
     }
     
 ----#define ACPI_COMPANION(dev)                to_acpi_node((dev)->fwnode)
 ++++#define ACPI_COMPANION(dev)                to_acpi_device_node((dev)->fwnode)
     #define ACPI_COMPANION_SET(dev, adev)      set_primary_fwnode(dev, (adev) ? \
        acpi_fwnode_handle(adev) : NULL)
     #define ACPI_HANDLE(dev)           acpi_device_handle(ACPI_COMPANION(dev))
     
     static inline bool has_acpi_companion(struct device *dev)
     {
 ----   return is_acpi_node(dev->fwnode);
 ++++   return is_acpi_device_node(dev->fwnode);
     }
     
     static inline void acpi_preset_companion(struct device *dev,
@@@@@@ -131,6 -131,6 -131,12 -131,6 -131,6 +131,12 @@@@@@ static inline void acpi_initrd_override
                (!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \
                ((struct acpi_subtable_header *)entry)->length < sizeof(*entry))
     
++ ++struct acpi_subtable_proc {
++ ++   int id;
++ ++   acpi_tbl_entry_handler handler;
++ ++   int count;
++ ++};
++ ++
     char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
     void __acpi_unmap_table(char *map, unsigned long size);
     int early_acpi_boot_init(void);
@@@@@@ -146,9 -146,9 -152,16 -146,9 -146,9 +152,16 @@@@@@ int __init acpi_parse_entries(char *id
                              struct acpi_table_header *table_header,
                              int entry_id, unsigned int max_entries);
     int __init acpi_table_parse_entries(char *id, unsigned long table_size,
-- --                               int entry_id,
-- --                               acpi_tbl_entry_handler handler,
-- --                               unsigned int max_entries);
++ ++                         int entry_id,
++ ++                         acpi_tbl_entry_handler handler,
++ ++                         unsigned int max_entries);
++ ++int __init acpi_table_parse_entries(char *id, unsigned long table_size,
++ ++                         int entry_id,
++ ++                         acpi_tbl_entry_handler handler,
++ ++                         unsigned int max_entries);
++ ++int __init acpi_table_parse_entries_array(char *id, unsigned long table_size,
++ ++                         struct acpi_subtable_proc *proc, int proc_num,
++ ++                         unsigned int max_entries);
     int acpi_table_parse_madt(enum acpi_madt_type id,
                          acpi_tbl_entry_handler handler,
                          unsigned int max_entries);
@@@@@@ -217,7 -217,6 -230,6 -217,6 -217,6 +230,7 @@@@@@ struct pci_dev
     
     int acpi_pci_irq_enable (struct pci_dev *dev);
     void acpi_penalize_isa_irq(int irq, int active);
 ++++bool acpi_isa_irq_available(int irq);
     void acpi_penalize_sci_irq(int irq, int trigger, int polarity);
     void acpi_pci_irq_disable (struct pci_dev *dev);
     
@@@@@@ -462,22 -461,7 -474,7 -461,7 -461,7 +475,22 @@@@@@ static inline bool is_acpi_node(struct 
        return false;
     }
     
 ----static inline struct acpi_device *to_acpi_node(struct fwnode_handle *fwnode)
 ++++static inline bool is_acpi_device_node(struct fwnode_handle *fwnode)
 ++++{
 ++++   return false;
 ++++}
 ++++
 ++++static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
 ++++{
 ++++   return NULL;
 ++++}
 ++++
 ++++static inline bool is_acpi_data_node(struct fwnode_handle *fwnode)
 ++++{
 ++++   return false;
 ++++}
 ++++
 ++++static inline struct acpi_data_node *to_acpi_data_node(struct fwnode_handle *fwnode)
     {
        return NULL;
     }
@@@@@@ -759,21 -743,22 -756,22 -743,22 -743,22 +772,21 @@@@@@ struct acpi_reference_args 
     #ifdef CONFIG_ACPI
     int acpi_dev_get_property(struct acpi_device *adev, const char *name,
                          acpi_object_type type, const union acpi_object **obj);
 ----int acpi_dev_get_property_array(struct acpi_device *adev, const char *name,
 ----                           acpi_object_type type,
 ----                           const union acpi_object **obj);
 ----int acpi_dev_get_property_reference(struct acpi_device *adev,
 ----                               const char *name, size_t index,
 ----                               struct acpi_reference_args *args);
 ----
 ----int acpi_dev_prop_get(struct acpi_device *adev, const char *propname,
 ----                 void **valptr);
 ++++int acpi_node_get_property_reference(struct fwnode_handle *fwnode,
 ++++                                const char *name, size_t index,
 ++++                                struct acpi_reference_args *args);
 ++++
 ++++int acpi_node_prop_get(struct fwnode_handle *fwnode, const char *propname,
 ++++                  void **valptr);
     int acpi_dev_prop_read_single(struct acpi_device *adev, const char *propname,
                              enum dev_prop_type proptype, void *val);
 ++++int acpi_node_prop_read(struct fwnode_handle *fwnode, const char *propname,
 ++++                   enum dev_prop_type proptype, void *val, size_t nval);
     int acpi_dev_prop_read(struct acpi_device *adev, const char *propname,
                       enum dev_prop_type proptype, void *val, size_t nval);
     
 ----struct acpi_device *acpi_get_next_child(struct device *dev,
 ----                                   struct acpi_device *child);
 ++++struct fwnode_handle *acpi_get_next_subnode(struct device *dev,
 ++++                                       struct fwnode_handle *subnode);
     #else
     static inline int acpi_dev_get_property(struct acpi_device *adev,
                                        const char *name, acpi_object_type type,
     {
        return -ENXIO;
     }
 ----static inline int acpi_dev_get_property_array(struct acpi_device *adev,
 ----                                         const char *name,
 ----                                         acpi_object_type type,
 ----                                         const union acpi_object **obj)
 ++++
 ++++static inline int acpi_node_get_property_reference(struct fwnode_handle *fwnode,
 ++++                           const char *name, const char *cells_name,
 ++++                           size_t index, struct acpi_reference_args *args)
     {
        return -ENXIO;
     }
 ----static inline int acpi_dev_get_property_reference(struct acpi_device *adev,
 ----                           const char *name, const char *cells_name,
 ----                           size_t index, struct acpi_reference_args *args)
 ++++
 ++++static inline int acpi_node_prop_get(struct fwnode_handle *fwnode,
 ++++                                const char *propname,
 ++++                                void **valptr)
     {
        return -ENXIO;
     }
@@@@@@ -811,14 -795,6 -808,6 -795,6 -795,6 +824,14 @@@@@@ static inline int acpi_dev_prop_read_si
        return -ENXIO;
     }
     
 ++++static inline int acpi_node_prop_read(struct fwnode_handle *fwnode,
 ++++                                 const char *propname,
 ++++                                 enum dev_prop_type proptype,
 ++++                                 void *val, size_t nval)
 ++++{
 ++++   return -ENXIO;
 ++++}
 ++++
     static inline int acpi_dev_prop_read(struct acpi_device *adev,
                                     const char *propname,
                                     enum dev_prop_type proptype,
        return -ENXIO;
     }
     
 ----static inline struct acpi_device *acpi_get_next_child(struct device *dev,
 ----                                                 struct acpi_device *child)
 ++++static inline struct fwnode_handle *acpi_get_next_subnode(struct device *dev,
 ++++                                           struct fwnode_handle *subnode)
     {
        return NULL;
     }
 ----
     #endif
     
     #endif     /*_LINUX_ACPI_H*/