Merge tag 'devprop-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull device properties framework updates from Rafael Wysocki:
 "These introduce fwnode operations for all of the separate types of
  'firmware nodes' that can be handled by the device properties
  framework, make the framework use const fwnode arguments all over, add
  a helper for the consolidated handling of node references and switch
  over the framework to the new UUID API.

  Specifics:

   - Introduce fwnode operations for all of the separate types of
     'firmware nodes' that can be handled by the device properties
     framework and drop the type field from struct fwnode_handle (Sakari
     Ailus, Arnd Bergmann).

   - Make the device properties framework use const fwnode arguments
     where possible (Sakari Ailus).

   - Add a helper for the consolidated handling of node references to
     the device properties framework (Sakari Ailus).

   - Switch over the ACPI part of the device properties framework to the
     new UUID API (Andy Shevchenko)"

* tag 'devprop-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: device property: Switch to use new generic UUID API
  device property: export irqchip_fwnode_ops
  device property: Introduce fwnode_property_get_reference_args
  device property: Constify fwnode property API
  device property: Constify argument to pset fwnode backend
  ACPI: Constify internal fwnode arguments
  ACPI: Constify acpi_bus helper functions, switch to macros
  ACPI: Prepare for constifying acpi_get_next_subnode() fwnode argument
  device property: Get rid of struct fwnode_handle type field
  ACPI: Use IS_ERR_OR_NULL() instead of non-NULL check in is_acpi_data_node()
This commit is contained in:
Linus Torvalds
2017-09-05 12:50:00 -07:00
11 changed files with 429 additions and 265 deletions

View File

@@ -395,35 +395,55 @@ struct acpi_data_node {
struct completion kobj_done;
};
static inline bool is_acpi_node(struct fwnode_handle *fwnode)
extern const struct fwnode_operations acpi_device_fwnode_ops;
extern const struct fwnode_operations acpi_data_fwnode_ops;
extern const struct fwnode_operations acpi_static_fwnode_ops;
static inline bool is_acpi_node(const struct fwnode_handle *fwnode)
{
return !IS_ERR_OR_NULL(fwnode) && (fwnode->type == FWNODE_ACPI
|| fwnode->type == FWNODE_ACPI_DATA);
return !IS_ERR_OR_NULL(fwnode) &&
(fwnode->ops == &acpi_device_fwnode_ops
|| fwnode->ops == &acpi_data_fwnode_ops);
}
static inline bool is_acpi_device_node(struct fwnode_handle *fwnode)
static inline bool is_acpi_device_node(const struct fwnode_handle *fwnode)
{
return !IS_ERR_OR_NULL(fwnode) && fwnode->type == FWNODE_ACPI;
return !IS_ERR_OR_NULL(fwnode) &&
fwnode->ops == &acpi_device_fwnode_ops;
}
static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
#define to_acpi_device_node(__fwnode) \
({ \
typeof(__fwnode) __to_acpi_device_node_fwnode = __fwnode; \
\
is_acpi_device_node(__to_acpi_device_node_fwnode) ? \
container_of(__to_acpi_device_node_fwnode, \
struct acpi_device, fwnode) : \
NULL; \
})
static inline bool is_acpi_data_node(const struct fwnode_handle *fwnode)
{
return is_acpi_device_node(fwnode) ?
container_of(fwnode, struct acpi_device, fwnode) : NULL;
return !IS_ERR_OR_NULL(fwnode) && fwnode->ops == &acpi_data_fwnode_ops;
}
static inline bool is_acpi_data_node(struct fwnode_handle *fwnode)
#define to_acpi_data_node(__fwnode) \
({ \
typeof(__fwnode) __to_acpi_data_node_fwnode = __fwnode; \
\
is_acpi_data_node(__to_acpi_data_node_fwnode) ? \
container_of(__to_acpi_data_node_fwnode, \
struct acpi_data_node, fwnode) : \
NULL; \
})
static inline bool is_acpi_static_node(const struct fwnode_handle *fwnode)
{
return fwnode && fwnode->type == FWNODE_ACPI_DATA;
return !IS_ERR_OR_NULL(fwnode) &&
fwnode->ops == &acpi_static_fwnode_ops;
}
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 bool acpi_data_node_match(struct fwnode_handle *fwnode,
static inline bool acpi_data_node_match(const struct fwnode_handle *fwnode,
const char *name)
{
return is_acpi_data_node(fwnode) ?