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
-------------------------------------------------------------------------- */
if (!id)
return;
- --- id->id = kstrdup(dev_id, GFP_KERNEL);
+ +++ id->id = kstrdup_const(dev_id, GFP_KERNEL);
if (!id->id) {
kfree(id);
return;
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);
}
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;
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);
struct acpi_hardware_id {
struct list_head list;
- --- char *id;
+ +++ const char *id;
};
struct acpi_pnp_type {
const union acpi_object *pointer;
const union acpi_object *properties;
const union acpi_object *of_compatible;
++++ struct list_head subnodes;
};
struct acpi_gpio_mapping;
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;
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,
(!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);
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);
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);
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;
}
#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;
}
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*/