diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2014-11-28 16:31:35 -0500 |
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2014-11-28 16:31:35 -0500 |
| commit | d60f5198ecfa9ed47e28fe9d416d5e9bcc662aca (patch) | |
| tree | 4d3a4f61c6b27b5f61ca93a7e5ebbd7c8b8cf873 /include/linux | |
| parent | f9cda64aa83b324953b11e2ca0a5b5c72a98a72e (diff) | |
| parent | 206c5f60a3d902bc4b56dab2de3e88de5eb06108 (diff) | |
Merge tag 'v3.18-rc4' into next/dt2
Linux 3.18-rc4 is a dependency for the phy-dt-header branch that
is needed for the final mvebu DT changes.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/cma.h | 8 | ||||
| -rw-r--r-- | include/linux/of.h | 84 | ||||
| -rw-r--r-- | include/linux/pci-acpi.h | 7 |
3 files changed, 80 insertions, 19 deletions
diff --git a/include/linux/cma.h b/include/linux/cma.h index 0430ed05d3b9..a93438beb33c 100644 --- a/include/linux/cma.h +++ b/include/linux/cma.h | |||
| @@ -18,12 +18,12 @@ struct cma; | |||
| 18 | extern phys_addr_t cma_get_base(struct cma *cma); | 18 | extern phys_addr_t cma_get_base(struct cma *cma); |
| 19 | extern unsigned long cma_get_size(struct cma *cma); | 19 | extern unsigned long cma_get_size(struct cma *cma); |
| 20 | 20 | ||
| 21 | extern int __init cma_declare_contiguous(phys_addr_t size, | 21 | extern int __init cma_declare_contiguous(phys_addr_t base, |
| 22 | phys_addr_t base, phys_addr_t limit, | 22 | phys_addr_t size, phys_addr_t limit, |
| 23 | phys_addr_t alignment, unsigned int order_per_bit, | 23 | phys_addr_t alignment, unsigned int order_per_bit, |
| 24 | bool fixed, struct cma **res_cma); | 24 | bool fixed, struct cma **res_cma); |
| 25 | extern int cma_init_reserved_mem(phys_addr_t size, | 25 | extern int cma_init_reserved_mem(phys_addr_t base, |
| 26 | phys_addr_t base, int order_per_bit, | 26 | phys_addr_t size, int order_per_bit, |
| 27 | struct cma **res_cma); | 27 | struct cma **res_cma); |
| 28 | extern struct page *cma_alloc(struct cma *cma, int count, unsigned int align); | 28 | extern struct page *cma_alloc(struct cma *cma, int count, unsigned int align); |
| 29 | extern bool cma_release(struct cma *cma, struct page *pages, int count); | 29 | extern bool cma_release(struct cma *cma, struct page *pages, int count); |
diff --git a/include/linux/of.h b/include/linux/of.h index 6545e7aec7bb..29f0adc5f3e4 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -267,14 +267,12 @@ extern int of_property_read_u64(const struct device_node *np, | |||
| 267 | extern int of_property_read_string(struct device_node *np, | 267 | extern int of_property_read_string(struct device_node *np, |
| 268 | const char *propname, | 268 | const char *propname, |
| 269 | const char **out_string); | 269 | const char **out_string); |
| 270 | extern int of_property_read_string_index(struct device_node *np, | ||
| 271 | const char *propname, | ||
| 272 | int index, const char **output); | ||
| 273 | extern int of_property_match_string(struct device_node *np, | 270 | extern int of_property_match_string(struct device_node *np, |
| 274 | const char *propname, | 271 | const char *propname, |
| 275 | const char *string); | 272 | const char *string); |
| 276 | extern int of_property_count_strings(struct device_node *np, | 273 | extern int of_property_read_string_helper(struct device_node *np, |
| 277 | const char *propname); | 274 | const char *propname, |
| 275 | const char **out_strs, size_t sz, int index); | ||
| 278 | extern int of_device_is_compatible(const struct device_node *device, | 276 | extern int of_device_is_compatible(const struct device_node *device, |
| 279 | const char *); | 277 | const char *); |
| 280 | extern int of_device_is_available(const struct device_node *device); | 278 | extern int of_device_is_available(const struct device_node *device); |
| @@ -486,15 +484,9 @@ static inline int of_property_read_string(struct device_node *np, | |||
| 486 | return -ENOSYS; | 484 | return -ENOSYS; |
| 487 | } | 485 | } |
| 488 | 486 | ||
| 489 | static inline int of_property_read_string_index(struct device_node *np, | 487 | static inline int of_property_read_string_helper(struct device_node *np, |
| 490 | const char *propname, int index, | 488 | const char *propname, |
| 491 | const char **out_string) | 489 | const char **out_strs, size_t sz, int index) |
| 492 | { | ||
| 493 | return -ENOSYS; | ||
| 494 | } | ||
| 495 | |||
| 496 | static inline int of_property_count_strings(struct device_node *np, | ||
| 497 | const char *propname) | ||
| 498 | { | 490 | { |
| 499 | return -ENOSYS; | 491 | return -ENOSYS; |
| 500 | } | 492 | } |
| @@ -668,6 +660,70 @@ static inline int of_property_count_u64_elems(const struct device_node *np, | |||
| 668 | } | 660 | } |
| 669 | 661 | ||
| 670 | /** | 662 | /** |
| 663 | * of_property_read_string_array() - Read an array of strings from a multiple | ||
| 664 | * strings property. | ||
| 665 | * @np: device node from which the property value is to be read. | ||
| 666 | * @propname: name of the property to be searched. | ||
| 667 | * @out_strs: output array of string pointers. | ||
| 668 | * @sz: number of array elements to read. | ||
| 669 | * | ||
| 670 | * Search for a property in a device tree node and retrieve a list of | ||
| 671 | * terminated string values (pointer to data, not a copy) in that property. | ||
| 672 | * | ||
| 673 | * If @out_strs is NULL, the number of strings in the property is returned. | ||
| 674 | */ | ||
| 675 | static inline int of_property_read_string_array(struct device_node *np, | ||
| 676 | const char *propname, const char **out_strs, | ||
| 677 | size_t sz) | ||
| 678 | { | ||
| 679 | return of_property_read_string_helper(np, propname, out_strs, sz, 0); | ||
| 680 | } | ||
| 681 | |||
| 682 | /** | ||
| 683 | * of_property_count_strings() - Find and return the number of strings from a | ||
| 684 | * multiple strings property. | ||
| 685 | * @np: device node from which the property value is to be read. | ||
| 686 | * @propname: name of the property to be searched. | ||
| 687 | * | ||
| 688 | * Search for a property in a device tree node and retrieve the number of null | ||
| 689 | * terminated string contain in it. Returns the number of strings on | ||
| 690 | * success, -EINVAL if the property does not exist, -ENODATA if property | ||
| 691 | * does not have a value, and -EILSEQ if the string is not null-terminated | ||
| 692 | * within the length of the property data. | ||
| 693 | */ | ||
| 694 | static inline int of_property_count_strings(struct device_node *np, | ||
| 695 | const char *propname) | ||
| 696 | { | ||
| 697 | return of_property_read_string_helper(np, propname, NULL, 0, 0); | ||
| 698 | } | ||
| 699 | |||
| 700 | /** | ||
| 701 | * of_property_read_string_index() - Find and read a string from a multiple | ||
| 702 | * strings property. | ||
| 703 | * @np: device node from which the property value is to be read. | ||
| 704 | * @propname: name of the property to be searched. | ||
| 705 | * @index: index of the string in the list of strings | ||
| 706 | * @out_string: pointer to null terminated return string, modified only if | ||
| 707 | * return value is 0. | ||
| 708 | * | ||
| 709 | * Search for a property in a device tree node and retrieve a null | ||
| 710 | * terminated string value (pointer to data, not a copy) in the list of strings | ||
| 711 | * contained in that property. | ||
| 712 | * Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if | ||
| 713 | * property does not have a value, and -EILSEQ if the string is not | ||
| 714 | * null-terminated within the length of the property data. | ||
| 715 | * | ||
| 716 | * The out_string pointer is modified only if a valid string can be decoded. | ||
| 717 | */ | ||
| 718 | static inline int of_property_read_string_index(struct device_node *np, | ||
| 719 | const char *propname, | ||
| 720 | int index, const char **output) | ||
| 721 | { | ||
| 722 | int rc = of_property_read_string_helper(np, propname, output, 1, index); | ||
| 723 | return rc < 0 ? rc : 0; | ||
| 724 | } | ||
| 725 | |||
| 726 | /** | ||
| 671 | * of_property_read_bool - Findfrom a property | 727 | * of_property_read_bool - Findfrom a property |
| 672 | * @np: device node from which the property value is to be read. | 728 | * @np: device node from which the property value is to be read. |
| 673 | * @propname: name of the property to be searched. | 729 | * @propname: name of the property to be searched. |
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 64dacb7288a6..24c7728ca681 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
| @@ -41,8 +41,13 @@ static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) | |||
| 41 | 41 | ||
| 42 | if (pci_is_root_bus(pbus)) | 42 | if (pci_is_root_bus(pbus)) |
| 43 | dev = pbus->bridge; | 43 | dev = pbus->bridge; |
| 44 | else | 44 | else { |
| 45 | /* If pbus is a virtual bus, there is no bridge to it */ | ||
| 46 | if (!pbus->self) | ||
| 47 | return NULL; | ||
| 48 | |||
| 45 | dev = &pbus->self->dev; | 49 | dev = &pbus->self->dev; |
| 50 | } | ||
| 46 | 51 | ||
| 47 | return ACPI_HANDLE(dev); | 52 | return ACPI_HANDLE(dev); |
| 48 | } | 53 | } |
