- 10 8月, 2016 1 次提交
-
-
由 Markus Elfring 提交于
The of_node_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 20 7月, 2016 1 次提交
-
-
由 Benjamin Herrenschmidt 提交于
This provides an equivalent of of_fdt_match() for non-flat trees. This is more practical than matching an array of of_device_id structs when converting a bunch of existing users of of_fdt_match(). Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
-
- 19 7月, 2016 1 次提交
-
-
由 Rob Herring 提交于
Clean-up all the DT printk functions to use common pr_fmt prefix. Some print statements such as kmalloc errors were redundant, so just drop those. Cc: Frank Rowand <frowand.list@gmail.com> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Reviewed-by: NFrank Rowand <frank.rowand@am.sony.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 25 6月, 2016 1 次提交
-
-
由 Frank Rowand 提交于
Fix a memory leak resulting from memory allocation in safe_name(). This patch fixes all call sites of safe_name(). Mathieu Malaterre reported the memory leak on boot: On my PowerMac device-tree would generate a duplicate name: [ 0.023043] device-tree: Duplicate name in PowerPC,G4@0, renamed to "l2-cache#1" in this case a newly allocated name is generated by `safe_name`. However in this case it is never deallocated. The bug was found using kmemleak reported as: unreferenced object 0xdf532e60 (size 32): comm "swapper", pid 1, jiffies 4294892300 (age 1993.532s) hex dump (first 32 bytes): 6c 32 2d 63 61 63 68 65 23 31 00 dd e4 dd 1e c2 l2-cache#1...... ec d4 ba ce 04 ec cc de 8e 85 e9 ca c4 ec cc 9e ................ backtrace: [<c02d3350>] kvasprintf+0x64/0xc8 [<c02d3400>] kasprintf+0x4c/0x5c [<c0453814>] safe_name.isra.1+0x80/0xc4 [<c04545d8>] __of_attach_node_sysfs+0x6c/0x11c [<c075f21c>] of_core_init+0x8c/0xf8 [<c0729594>] kernel_init_freeable+0xd4/0x208 [<c00047e8>] kernel_init+0x24/0x11c [<c00158ec>] ret_from_kernel_thread+0x5c/0x64 Link: https://bugzilla.kernel.org/show_bug.cgi?id=120331Signed-off-by: NFrank Rowand <frank.rowand@am.sony.com> Reported-by: mathieu.malaterre@gmail.com Tested-by: NMathieu Malaterre <mathieu.malaterre@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: NRob Herring <robh@kernel.org>
-
- 11 5月, 2016 1 次提交
-
-
由 Suraj Jitindar Singh 提交于
The validity of the property input argument to of_remove_property() is never checked within the function and thus it is possible to pass a null value. It happens that this will be picked up in __of_remove_property() as no matching property of the device node will be found and thus an error will be returned, however once again there is no explicit check for a null value. By the time this is detected 2 locks have already been acquired which is completely unnecessary if the property to remove is null. Add an explicit check in the function of_remove_property() for a null property value and return -ENODEV in this case, this is consistent with what the previous return value would have been when the null value was not detected and passed to __of_remove_property(). By moving an explicit check for the property paramenter into the of_remove_property() function, this will remove the need to perform this check in calling code before invocation of the of_remove_property() function. Signed-off-by: NSuraj Jitindar Singh <sjitindarsingh@gmail.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
-
- 25 4月, 2016 1 次提交
-
-
由 Masahiro Yamada 提交于
This function increments refcount. This is worth noting. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NFrank Rowand <frank.rowand@am.sony.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 20 4月, 2016 5 次提交
-
-
由 Joerg Roedel 提交于
This helper function can be used to copy the arguments of a phandle to an array. Signed-off-by: NJoerg Roedel <jroedel@suse.de> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Joerg Roedel 提交于
With this macro any user can easily iterate over a list of phandles. The patch also converts __of_parse_phandle_with_args() to make use of the macro. The of_count_phandle_with_args() function is not converted, because the macro hides the return value of of_phandle_iterator_init(), which is needed in there. Signed-off-by: NJoerg Roedel <jroedel@suse.de> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Joerg Roedel 提交于
The index = -1 case in __of_parse_phandle_with_args() is used to just return the number of phandles. That special case needs extra handling, so move it to the place where it is needed: of_count_phandle_with_args(). This allows to further simplify __of_parse_phandle_with_args() later on. Signed-off-by: NJoerg Roedel <jroedel@suse.de> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Joerg Roedel 提交于
Move the code to walk over the phandles out of the loop in __of_parse_phandle_with_args() to a separate function that just works with the iterator handle: of_phandle_iterator_next(). Signed-off-by: NJoerg Roedel <jroedel@suse.de> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Joerg Roedel 提交于
This struct carrys all necessary information to iterate over a list of phandles and extract the arguments. Add an init-function for the iterator and make use of it in __of_parse_phandle_with_args(). Signed-off-by: NJoerg Roedel <jroedel@suse.de> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 04 3月, 2016 1 次提交
-
-
由 David Rivshin 提交于
The of_property_{read,count,match}_string* family of functions never modify the struct device_node pointer that is passed in, so there is no reason for it to be non-const. Equivalent functions for all other types already take a 'const struct device_node *np'. Signed-off-by: NDavid Rivshin <drivshin@allworx.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 31 10月, 2015 1 次提交
-
-
由 Masahiro Yamada 提交于
This commit does not change the function behavior. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 23 6月, 2015 1 次提交
-
-
由 Dave Airlie 提交于
This symbol came via exynos-next, but modular builds are broken so just fix it up now. Signed-off-by: NDave Airlie <airlied@redhat.com>
-
- 22 6月, 2015 1 次提交
-
-
由 Hyungwon Hwang 提交于
When there are multiple ports or multiple endpoints in a port, they have to be distinguished by the value of reg property. It is common. The drivers can get the specific endpoint in the specific port via this function. Now the drivers have to implement this code in themselves or have to force the order of dt nodes to get the right node. Signed-off-by: NHyungwon Hwang <human.hwang@samsung.com> Acked-by: NRob Herring <robh+dt@kernel.org> Signed-off-by: NInki Dae <inki.dae@samsung.com>
-
- 04 6月, 2015 1 次提交
-
-
由 Konstantin Khlebnikov 提交于
Node 0 might be offline as well as any other numa node, in this case kernel cannot handle memory allocation and crashes. Signed-off-by: NKonstantin Khlebnikov <khlebnikov@yandex-team.ru> Fixes: 0c3f061c ("of: implement of_node_to_nid as a weak function") Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 27 5月, 2015 1 次提交
-
-
由 Sudeep Holla 提交于
Commit 5590f319 ("drivers/core/of: Add symlink to device-tree from devices with an OF node") adds the symlink `of_node` for each device pointing to it's device tree node while creating/initialising it. However the devicetree sysfs is created and setup in of_init which is executed at core_initcall level. For all the devices created before of_init, the following error is thrown: "Error -2(-ENOENT) creating of_node link" Like many other components in driver model, initialize the sysfs support for OF/devicetree from driver_init so that it's ready before any devices are created. Fixes: 5590f319 ("drivers/core/of: Add symlink to device-tree from devices with an OF node") Suggested-by: NRob Herring <robh+dt@kernel.org> Cc: Grant Likely <grant.likely@linaro.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: NSudeep Holla <sudeep.holla@arm.com> Tested-by: NRobert Schwebel <r.schwebel@pengutronix.de> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 25 5月, 2015 1 次提交
-
-
由 Sudeep Holla 提交于
Commit 5590f319 ("drivers/core/of: Add symlink to device-tree from devices with an OF node") adds the symlink `of_node` for each device pointing to it's device tree node while creating/initialising it. However the devicetree sysfs is created and setup in of_init which is executed at core_initcall level. For all the devices created before of_init, the following error is thrown: "Error -2(-ENOENT) creating of_node link" Like many other components in driver model, initialize the sysfs support for OF/devicetree from driver_init so that it's ready before any devices are created. Fixes: 5590f319 ("drivers/core/of: Add symlink to device-tree from devices with an OF node") Suggested-by: NRob Herring <robh+dt@kernel.org> Cc: Grant Likely <grant.likely@linaro.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: NSudeep Holla <sudeep.holla@arm.com> Tested-by: NRobert Schwebel <r.schwebel@pengutronix.de> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 17 4月, 2015 1 次提交
-
-
由 Baruch Siach 提交于
Add two new facts to of_get_next_child() documentation: * of_get_next_child() returns NULL when there is not next child * of_get_next_child() decrements the refcount of prev Signed-off-by: NBaruch Siach <baruch@tkos.co.il> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 15 4月, 2015 1 次提交
-
-
由 Kevin Cernekee 提交于
SoC peripherals can come in several different flavors: - little-endian: registers always need to be accessed in LE mode (so the kernel should perform a swap if the CPU is running BE) - big-endian: registers always need to be accessed in BE mode (so the kernel should perform a swap if the CPU is running LE) - native-endian: the bus will automatically swap accesses, so the kernel should never swap Introduce a function that checks an OF device node to see whether it contains a "big-endian" or "native-endian" property. For the former case, always return true. For the latter case, return true iff the kernel was built for BE (implying that the BE MMIO accessors do not perform a swap). Otherwise return false, assuming LE registers. LE registers are assumed by default because most existing drivers (libahci, serial8250, usb) always use readl/writel in the absence of instructions to the contrary, so that will be our fallback. Signed-off-by: NKevin Cernekee <cernekee@gmail.com> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 19 3月, 2015 2 次提交
-
-
由 Peter Hurley 提交于
This reverts commit 2fa645cb. The assumption that at least 1 preferred console will be registered when the stdout-path property is set is invalid, which can result in _no_ consoles. Signed-off-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Brian Norris 提交于
Commit 106937e8 ("of: fix handling of '/' in options for of_find_node_by_path()") caused a regression in OF handling of stdout-path. While it fixes some cases which have '/' after the ':', it breaks cases where there is more than one '/' *before* the ':'. For example, it breaks this boot string stdout-path = "/rdb/serial@f040ab00:115200"; So rather than doing sequentialized checks (first for '/', then for ':'; or vice versa), to get the correct behavior we need to check for the first occurrence of either one of them. It so happens that the handy strcspn() helper can do just that. Fixes: 106937e8 ("of: fix handling of '/' in options for of_find_node_by_path()") Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Cc: stable@vger.kernel.org # 3.19 Acked-by: NLeif Lindholm <leif.lindholm@linaro.org> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 18 3月, 2015 1 次提交
-
-
由 Wolfram Sang 提交于
I2C supports adding adapters using either a dynamic or fixed id. The latter is provided by aliases in the DT case. To prevent id collisions of those two types, install this function which gives us the highest fixed id, so we can then let the dynamically created ones come after this highest number. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 10 3月, 2015 2 次提交
-
-
由 Leif Lindholm 提交于
Ensure proper handling of paths with appended options (after ':'), where those options may contain a '/'. Fixes: 7914a7c5 ("of: support passing console options with stdout-path") Reported-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NLeif Lindholm <leif.lindholm@linaro.org> Cc: <stable@vger.kernel.org> # 3.19 Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Peter Hurley 提交于
Support for devicetree serial consoles via 'stdout-path' causes bootconsoles to be disabled when the vt dummy console loads, since there is no preferred console (the preferred console is not added until the device is probed). Ensure there is at least a preferred console, even if never matched. Requires: "console: Fix console name size mismatch" Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 23 2月, 2015 2 次提交
-
-
由 Philipp Zabel 提交于
This patch adds a function to get a port device tree node by port id, or reg property value. Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de> Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
-
由 Philipp Zabel 提交于
Decrementing the reference count of the previous endpoint node allows to use the of_graph_get_next_endpoint function in a for_each_... style macro. All current users of this function that pass a non-NULL prev parameter (that is, soc_camera and imx-drm) are changed to not decrement the passed prev argument's refcount themselves. Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de> Acked-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: NMathieu Poirier <mathieu.poirier@linaro.org> Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
-
- 04 2月, 2015 1 次提交
-
-
由 Sakari Ailus 提交于
Make of_property_read_u64_array() available for modules as well. This was missing from the patch which originally added the function. Signed-off-by: NSakari Ailus <sakari.ailus@iki.fi> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 04 12月, 2014 2 次提交
-
-
由 Leif Lindholm 提交于
Support specifying console options (like with console=ttyXN,<options>) by appending them to the stdout-path property after a separating ':'. Example: stdout-path = "uart0:115200"; Signed-off-by: NLeif Lindholm <leif.lindholm@linaro.org> [grant.likely: minor rework to shorten the diffstat] Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Leif Lindholm 提交于
Update of_find_node_by_path(): 1) Rename function to of_find_node_opts_by_path(), adding an optional pointer argument. Provide a static inline wrapper version of of_find_node_by_path() which calls the new function with NULL as the optional argument. 2) Ignore any part of the path beyond and including the ':' separator. 3) Set the new provided pointer argument to the beginning of the string following the ':' separator. 4: Add tests. Signed-off-by: NLeif Lindholm <leif.lindholm@linaro.org> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 28 11月, 2014 1 次提交
-
-
由 Jiri Slaby 提交于
It referenced of_property_read_string_util whereas the function name is of_property_read_string_helper. Introduced in a87fa1d8 (of: Fix overflow bug in string property parsing functions). Found out when reviewing the stable 3.12 queue. Signed-off-by: NJiri Slaby <jslaby@suse.cz> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 19 11月, 2014 2 次提交
-
-
由 Kevin Cernekee 提交于
This function can only return true or false; using a bool makes it more obvious to the reader. Signed-off-by: NKevin Cernekee <cernekee@gmail.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Kevin Cernekee 提交于
This function passes back a value from __of_device_is_compatible(), which returns a score in the range 0..11, not a bool. Signed-off-by: NKevin Cernekee <cernekee@gmail.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 05 11月, 2014 5 次提交
-
-
由 Rafael J. Wysocki 提交于
Add a uniform interface by which device drivers can request device properties from the platform firmware by providing a property name and the corresponding data type. The purpose of it is to help to write portable code that won't depend on any particular platform firmware interface. The following general helper functions are added: device_property_present() device_property_read_u8() device_property_read_u16() device_property_read_u32() device_property_read_u64() device_property_read_string() device_property_read_u8_array() device_property_read_u16_array() device_property_read_u32_array() device_property_read_u64_array() device_property_read_string_array() The first one allows the caller to check if the given property is present. The next 5 of them allow single-valued properties of various types to be retrieved in a uniform way. The remaining 5 are for reading properties with multiple values (arrays of either numbers or strings). The interface covers both ACPI and Device Trees. This change set includes material from Mika Westerberg and Aaron Lu. Signed-off-by: NAaron Lu <aaron.lu@intel.com> Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: NGrant Likely <grant.likely@linaro.org> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
由 Geert Uytterhoeven 提交于
Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Geert Uytterhoeven 提交于
Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Geert Uytterhoeven 提交于
Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Geert Uytterhoeven 提交于
The device_node pointer in struct of_phandle_args is called "np", not "node". Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 04 11月, 2014 2 次提交
-
-
由 Grant Likely 提交于
The device tree structure is composed of two lists; the 'allnodes' list which is a singly linked list containing every node in the tree, and the child->parent structure where each parent node has a singly linked list of children. All of the data in the allnodes list can be easily reproduced with the parent-child lists, so of_allnodes is actually unnecessary. Remove it entirely which saves a bit of memory and simplifies the data structure quite a lot. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Cc: Rob Herring <robh@kernel.org> Cc: Gaurav Minocha <gaurav.minocha.os@gmail.com> Cc: Pantelis Antoniou <pantelis@pantelis.antoniou@konsulko.com>
-
由 Grant Likely 提交于
The string property read helpers will run off the end of the buffer if it is handed a malformed string property. Rework the parsers to make sure that doesn't happen. At the same time add new test cases to make sure the functions behave themselves. The original implementations of of_property_read_string_index() and of_property_count_strings() both open-coded the same block of parsing code, each with it's own subtly different bugs. The fix here merges functions into a single helper and makes the original functions static inline wrappers around the helper. One non-bugfix aspect of this patch is the addition of a new wrapper, of_property_read_string_array(). The new wrapper is needed by the device_properties feature that Rafael is working on and planning to merge for v3.19. The implementation is identical both with and without the new static inline wrapper, so it just got left in to reduce the churn on the header file. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Rob Herring <robh+dt@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Darren Hart <darren.hart@intel.com> Cc: <stable@vger.kernel.org> # v3.3+: Drop selftest hunks that don't apply
-