- 24 7月, 2014 2 次提交
-
-
由 Grant Likely 提交于
PowerPC does an odd thing with dynamic nodes. It uses a notifier to catch new node additions and set some of the values like name and type. This makes no sense since that same code can be put directly into of_attach_node(). Besides, all dynamic node users need this, not just powerpc. Fix this problem by moving the logic out of arch/powerpc and into drivers/of/dynamic.c. It is also important to remove this notifier because we want to move the firing of notifiers from before the tree is modified to after so that the receiver gets a consistent view of the tree, but that is incompatible with notifiers that modify the node. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Cc: Nathan Fontenot <nfont@austin.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-
由 Grant Likely 提交于
All of the DT modification functions are split into two parts, the first part manipulates the DT data structure, and the second part updates sysfs, but the code isn't very consistent about how the second half is called. They don't all enforce the same rules about when it is valid to update sysfs, and there isn't any clarity on locking. The transactional DT modification feature that is coming also needs access to these functions so that it can perform all the structure changes together, and then all the sysfs updates as a second stage instead of doing each one at a time. Fix up the second have by creating a separate __of_*_sysfs() function for each of the helpers. The new functions have consistent naming (ie. of_node_add() becomes __of_attach_node_sysfs()) and all of them now defer if of_init hasn't been called yet. Callers of the new functions must hold the of_mutex to ensure there are no race conditions with of_init(). The mutex ensures that there will only ever be one writer to the tree at any given time. There can still be any number of readers and the raw_spin_lock is still used to make sure access to the data structure is still consistent. Finally, put the function prototypes into of_private.h so they are accessible to the transaction code. Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com> [grant.likely: Changed suffix from _post to _sysfs to match existing code] [grant.likely: Reorganized to eliminate trivial wrappers] Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 16 7月, 2014 1 次提交
-
-
由 Pantelis Antoniou 提交于
The DT overlay code will need to manipulate nodes and properties while already holding the devicetree lock, or on nodes that are not yet attached to the tree, but the current helper functions don't allow that. Extract the core behaviour from the accessors and create the following unlocked variants. The unlocked variants require either the lock to already be held or for the nodes to be detached from the tree. Changes to live nodes will not get updated in sysfs, so the caller must arrange for housekeeping to take place after dropping the lock. The new functions are: __of_add_property(), __of_remove_property(), __of_update_property(), __of_attach_node() and __of_detach_node(). Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com> [Remove unnecessary diff hunks and rewrite commit text] Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 07 7月, 2014 2 次提交
-
-
由 Grant Likely 提交于
Split the dynamic device tree code into a separate file to make it really clear what features CONFIF_OF_DYNAMIC add to the kernel. Without CONFIG_OF_DYNAMIC only properties can be changed, and notifiers do not get sent. Enabling it turns on reference counting, notifiers and the ability to add and remove nodes. v2: Moved of_node_release() into dynamic.c Signed-off-by: NGrant Likely <grant.likely@linaro.org> Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Rob Herring <robh+dt@kernel.org>
-
由 Pantelis Antoniou 提交于
We're overloading usage of of_aliases_mutex for sysfs changes, so rename to something that is more generic. Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 17 6月, 2014 2 次提交
-
-
由 Frank Rowand 提交于
of_find_node_by_path() is borked because of_allnodes is not guaranteed to contain the root of the tree after using any of the dynamic update functions because some other nodes ends up as of_allnodes. Fixes: c22e650e of: Make of_find_node_by_path() handle /aliases Reported-by: pantelis.antoniou@konsulko.com Signed-off-by: NFrank Rowand <frank.rowand@sonymobile.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Kees Cook 提交于
This makes sure a format string cannot leak into the kobject name that is constructed. (And splits the >80 character line.) Signed-off-by: NKees Cook <keescook@chromium.org> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 04 6月, 2014 1 次提交
-
-
由 Florian Fainelli 提交于
Add an early check for the node argument in __of_get_next_child and of_get_next_available_child() to avoid dereferencing a NULL node pointer a few lines after. CC: Daniel Mack <zonque@gmail.com> Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 23 5月, 2014 3 次提交
-
-
由 Grant Likely 提交于
Make of_find_node_by_path() handle aliases as prefixes. To make this work the name search is refactored to search by path component instead of by full string. This should be a more efficient search, and it makes it possible to start a search at a subnode of a tree. Signed-off-by: NDavid Daney <david.daney@cavium.com> Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com> [grant.likely: Rework to not require allocating at runtime] Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Grant Likely 提交于
When iterating over nodes, sometimes it needs to be done when the DT lock is already held. This patch makes an unlocked version of the for_each_child_of_node() macro. Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Xiubo Li 提交于
The of_update_property() is intented to update a property in a node and if the property does not exist, will add it. The second search of the property is possibly won't be found, that maybe removed by other thread just before the second search begain. Using the __of_find_property() and __of_add_property() instead and move them into lock operations. Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> [grant.likely: conflict with another change in same function] Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 14 5月, 2014 1 次提交
-
-
由 Thomas Petazzoni 提交于
Commit 75b57ecf ('of: Make device nodes kobjects so they show up in sysfs') has turned Device Tree nodes in kobjects and added a sysfs based representation for Device Tree nodes. Since the sysfs logic is only available after the execution of a core_initcall(), the patch took precautions in of_add_property() and of_remove_property() to not do any sysfs related manipulation early in the boot process. However, it forgot to do the same for of_update_property(), which if used early in the boot process (before core_initcalls have been called), tries to call sysfs_remove_bin_file(), and crashes: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at /home/thomas/projets/linux-2.6/fs/kernfs/dir.c:1216 kernfs_remove_by_name_ns+0x80/0x88() kernfs: can not remove '(null)', no directory Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.15.0-rc1-00127-g1d7e7b2-dirty #423 [<c0014910>] (unwind_backtrace) from [<c00110ec>] (show_stack+0x10/0x14) [<c00110ec>] (show_stack) from [<c04c84b8>] (dump_stack+0x84/0x94) [<c04c84b8>] (dump_stack) from [<c001d8c0>] (warn_slowpath_common+0x6c/0x88) [<c001d8c0>] (warn_slowpath_common) from [<c001d90c>] (warn_slowpath_fmt+0x30/0x40) [<c001d90c>] (warn_slowpath_fmt) from [<c0104468>] (kernfs_remove_by_name_ns+0x80/0x88) [<c0104468>] (kernfs_remove_by_name_ns) from [<c0394d98>] (of_update_property+0xc0/0xf0) [<c0394d98>] (of_update_property) from [<c0647248>] (mvebu_timer_and_clk_init+0xfc/0x194) [<c0647248>] (mvebu_timer_and_clk_init) from [<c0640934>] (start_kernel+0x218/0x350) [<c0640934>] (start_kernel) from [<00008070>] (0x8070) ---[ end trace 3406ff24bd97382e ]--- Unable to handle kernel NULL pointer dereference at virtual address 0000003c pgd = c0004000 [0000003c] *pgd=00000000 Internal error: Oops: 5 [#1] SMP ARM Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 3.15.0-rc1-00127-g1d7e7b2-dirty #423 task: c10ad4d8 ti: c10a2000 task.ti: c10a2000 PC is at kernfs_find_ns+0x8/0xf0 LR is at kernfs_find_and_get_ns+0x30/0x48 pc : [<c0103834>] lr : [<c010394c>] psr: 600001d3 sp : c10a3f34 ip : 00000073 fp : 00000000 r10: 00000000 r9 : cfffc240 r8 : cfdf2980 r7 : cf812c00 r6 : 00000000 r5 : 00000000 r4 : c10b45e0 r3 : c10ad4d8 r2 : 00000000 r1 : cf812c00 r0 : 00000000 Flags: nZCv IRQs off FIQs off Mode SVC_32 ISA ARM Segment kernel Control: 10c53c7d Table: 0000404a DAC: 00000015 Process swapper/0 (pid: 0, stack limit = 0xc10a2240) Stack: (0xc10a3f34 to 0xc10a4000) 3f20: c10b45e0 00000000 00000000 3f40: cf812c00 c010394c 00000063 cf812c00 00000001 cf812c00 cfdf29ac c03932cc 3f60: 00000063 cf812bc0 cfdf29ac cf812c00 ffffffff c03943f8 cfdf2980 c0104468 3f80: cfdf2a04 cfdf2980 cf812bc0 c06634b0 c10aa3c0 c0394da4 c10f74dc cfdf2980 3fa0: cf812bc0 c0647248 c10aa3c0 ffffffff c10de940 c10aa3c0 ffffffff c0640934 3fc0: ffffffff ffffffff c06404ec 00000000 00000000 c06634b0 00000000 10c53c7d 3fe0: c10aa434 c06634ac c10ae4c8 0000406a 414fc091 00008070 00000000 00000000 [<c0103834>] (kernfs_find_ns) from [<00000001>] (0x1) Code: e5c89001 eaffffcf e92d40f0 e1a06002 (e1d023bc) ---[ end trace 3406ff24bd97382f ]--- Kernel panic - not syncing: Attempted to kill the idle task! ---[ end Kernel panic - not syncing: Attempted to kill the idle task! To fix this problem, we simply skip the sysfs related calls in of_update_property(), and rely on of_init() to fix up things when it will be called, exactly as is done in of_add_property() and of_remove_property(). Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Fixes: 75b57ecf ("of: Make device nodes kobjects so they show up in sysfs") Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 05 5月, 2014 1 次提交
-
-
由 Geert Uytterhoeven 提交于
Signed-off-by: NGeert Uytterhoeven <geert+renesas@linux-m68k.org> Acked-by: NRob Herring <robh@kernel.org> Cc: Grant Likely <grant.likely@linaro.org> Cc: devicetree@vger.kernel.org Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 16 4月, 2014 1 次提交
-
-
由 Guenter Roeck 提交于
After searching for the old property, bail out with -ENODEV if it was not found. It is unnecessary to check if oldprop is NULL before removing its binary file; the check was already done before. Signed-off-by: NGuenter Roeck <linux@roeck-us.net> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 28 3月, 2014 1 次提交
-
-
由 Grant Likely 提交于
ePAPR 1.1 defines the "stdout-path" property for specifying the console device, but Linux currently only handles the older "linux,stdout-path" property. This patch adds parsing for the new property name. Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 19 3月, 2014 1 次提交
-
-
由 Pantelis Antoniou 提交于
After the move to having device nodes be proper kobjects the lifecycle of the node needs to be controlled better. At first convert of_add_node() in the unflattened functions to of_init_node() which initializes the kobject so that of_node_get/put work correctly even before of_init is called. Afterwards introduce of_node_is_initialized & of_node_is_attached that query the underlying kobject about the state (attached means kobj is visible in sysfs) Using that make sure the lifecycle of the tree is correct at all times. Signed-off-by: NPantelis Antoniou <panto@antoniou-consulting.com> [grant.likely: moved of_node_init() calls, fixed up locking, and dropped __of_populate() hunks] Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 12 3月, 2014 2 次提交
-
-
由 Grant Likely 提交于
The same data is now available in sysfs, so we can remove the code that exports it in /proc and replace it with a symlink to the sysfs version. Tested on versatile qemu model and mpc5200 eval board. More testing would be appreciated. v5: Fixed up conflicts with mainline changes Signed-off-by: NGrant Likely <grant.likely@secretlab.ca> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: David S. Miller <davem@davemloft.net> Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
-
由 Grant Likely 提交于
Device tree nodes are already treated as objects, and we already want to expose them to userspace which is done using the /proc filesystem today. Right now the kernel has to do a lot of work to keep the /proc view in sync with the in-kernel representation. If device_nodes are switched to be kobjects then the device tree code can be a whole lot simpler. It also turns out that switching to using /sysfs from /proc results in smaller code and data size, and the userspace ABI won't change if /proc/device-tree symlinks to /sys/firmware/devicetree/base. v7: Add missing sysfs_bin_attr_init() v6: Add __of_add_property() early init fixes from Pantelis v5: Rename firmware/ofw to firmware/devicetree Fix updating property values in sysfs v4: Fixed build error on Powerpc Fixed handling of dynamic nodes on powerpc v3: Fixed handling of duplicate attribute and child node names v2: switch to using sysfs bin_attributes which solve the problem of reporting incorrect property size. Signed-off-by: NGrant Likely <grant.likely@secretlab.ca> Tested-by: NSascha Hauer <s.hauer@pengutronix.de> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: David S. Miller <davem@davemloft.net> Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
-
- 07 3月, 2014 5 次提交
-
-
由 Philipp Zabel 提交于
If of_graph_parse_endpoint is given a parentless node instead of an endpoint node, it is clearly a bug. Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de> Acked-by: NTomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: NMauro Carvalho Chehab <m.chehab@samsung.com> Acked-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
-
由 Philipp Zabel 提交于
This patch adds a new struct of_endpoint which is then embedded in struct v4l2_of_endpoint and contains the endpoint properties that are not V4L2 (or even media) specific: the port number, endpoint id, local device tree node and remote endpoint phandle. of_graph_parse_endpoint parses those properties and is used by v4l2_of_parse_endpoint, which just adds the V4L2 MBUS information to the containing v4l2_of_endpoint structure. Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de> Acked-by: NTomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: NMauro Carvalho Chehab <m.chehab@samsung.com> Acked-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
-
由 Philipp Zabel 提交于
A 'return endpoint;' at the end of the (!prev) case allows to reduce the indentation level of the (prev) case. Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de> Acked-by: NTomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: NMauro Carvalho Chehab <m.chehab@samsung.com> Acked-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
-
由 Philipp Zabel 提交于
If of_graph_get_next_endpoint is given a parentless node instead of an endpoint node, it is clearly a bug. Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de> Acked-by: NTomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: NMauro Carvalho Chehab <m.chehab@samsung.com> Acked-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
-
由 Philipp Zabel 提交于
This patch moves the parsing helpers used to parse connected graphs in the device tree, like the video interface bindings documented in Documentation/devicetree/bindings/media/video-interfaces.txt, from drivers/media/v4l2-core/v4l2-of.c into drivers/of/base.c. This allows to reuse the same parser code from outside the V4L2 framework, most importantly from display drivers. The functions v4l2_of_get_next_endpoint, v4l2_of_get_remote_port, and v4l2_of_get_remote_port_parent are moved. They are renamed to of_graph_get_next_endpoint, of_graph_get_remote_port, and of_graph_get_remote_port_parent, respectively. Since there are not that many current users yet, switch all of them to the new functions right away. Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de> Acked-by: NTomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: NMauro Carvalho Chehab <m.chehab@samsung.com> Acked-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
-
- 04 3月, 2014 1 次提交
-
-
由 Grant Likely 提交于
This reverts commit 02ed594e. The change is completely broken. It attempt to get the previous item in a linked list by grabbing the address of a stack variable. Outright wrong. Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 20 2月, 2014 1 次提交
-
-
由 Kevin Hao 提交于
In the current implementation of __of_match_node(), it will compare each given match entry against all the node's compatible strings with of_device_is_compatible(). To achieve multiple compatible strings per node with ordering from specific to generic, this requires given matches to be ordered from specific to generic. For most of the drivers this is not true and also an alphabetical ordering is more sane there. Therefore, we define a following priority order for the match, and then scan all the entries to find the best match. 1. specific compatible && type && name 2. specific compatible && type 3. specific compatible && name 4. specific compatible 5. general compatible && type && name 6. general compatible && type 7. general compatible && name 8. general compatible 9. type && name 10. type 11. name v5: Fix nested locking bug v4: Short-circuit failure cases instead of mucking with score, and remove extra __of_device_is_compatible() wrapper stub. Move scoring logic directly into __of_device_is_compatible() v3: Also need to bail out when there does have a compatible member in match entry, but it doesn't match with the device node's compatible. v2: Fix the bug such as we get the same score for the following two match entries with the empty node 'name2 { };' struct of_device_id matches[] = { {.name = "name2", }, {.name = "name2", .type = "type1", }, {} }; Signed-off-by: NKevin Hao <haokexin@gmail.com> [grant.likely: added v4 changes] Signed-off-by: NGrant Likely <grant.likely@linaro.org> Tested-by: NPaul Gortmaker <paul.gortmaker@windriver.com> Tested-by: NStephen Chivers <schivers@csc.com> Tested-by: NSachin Kamat <sachin.kamat@linaro.org>
-
- 19 2月, 2014 1 次提交
-
-
由 Kevin Hao 提交于
This reverts commit 06b29e76. As pointed out by Grant Likely, we should also take the type and name into account when searching the best compatible match. That means the match with compatible, type and name should be better than the match just with the same compatible string. So revert this and we will implement another method to find the best match entry. Signed-off-by: NKevin Hao <haokexin@gmail.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 16 2月, 2014 1 次提交
-
-
由 Kevin Hao 提交于
Currently, of_match_node compares each given match against all node's compatible strings with of_device_is_compatible. To achieve multiple compatible strings per node with ordering from specific to generic, this requires given matches to be ordered from specific to generic. For most of the drivers this is not true and also an alphabetical ordering is more sane there. Therefore, this patch introduces a function to match each of the node's compatible strings against all given compatible matches without type and name first, before checking the next compatible string. This implies that node's compatibles are ordered from specific to generic while given matches can be in any order. If we fail to find such a match entry, then fall-back to the old method in order to keep compatibility. Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: NKevin Hao <haokexin@gmail.com> Tested-by: NStephen Chivers <schivers@csc.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 15 2月, 2014 1 次提交
-
-
由 Kevin Hao 提交于
This reverts commit 10535314. Stephen Chivers reported this is broken as we will get a match entry '.type = "serial"' instead of the '.compatible = "ns16550"' in the following scenario: serial0: serial@4500 { compatible = "fsl,ns16550", "ns16550"; } struct of_device_id of_platform_serial_table[] = { { .compatible = "ns8250", .data = (void *)PORT_8250, }, { .compatible = "ns16450", .data = (void *)PORT_16450, }, { .compatible = "ns16550a", .data = (void *)PORT_16550A, }, { .compatible = "ns16550", .data = (void *)PORT_16550, }, { .compatible = "ns16750", .data = (void *)PORT_16750, }, { .compatible = "ns16850", .data = (void *)PORT_16850, }, ... { .type = "serial", .data = (void *)PORT_UNKNOWN, }, { /* end of list */ }, }; So just revert this patch, we will use another implementation to find the best compatible match in a follow-on patch. Reported-by: NStephen N Chivers <schivers@csc.com.au> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: NKevin Hao <haokexin@gmail.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 12 2月, 2014 1 次提交
-
-
由 Heiko Stuebner 提交于
The need to know the number of array elements in a property is a common pattern. To prevent duplication of open-coded implementations add a helper static function that also centralises strict sanity checking and DTB format details, as well as a set of wrapper functions for u8, u16, u32 and u64. Suggested-by: NMark Rutland <mark.rutland@arm.com> Signed-off-by: NHeiko Stuebner <heiko.stuebner@bqreaders.com> Acked-by: NRob Herring <robh@kernel.org> Acked-by: NGrant Likely <grant.likely@linaro.org> Acked-by: NMark Rutland <mark.rutland@arm.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 05 2月, 2014 2 次提交
-
-
由 Xiubo Li 提交于
The of_update_property() is intented to update a property in a node and if the property does not exist, will add it. The second search of the property is possibly won't be found, that maybe removed by other thread just before the second search begain. Using the __of_find_property() and __of_add_property() instead and move them into lock operations. Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Xiubo Li 提交于
There two places will use the same code for adding one new property to the DT node. Adding __of_add_property() and prepare for fixing of_update_property()'s bug. Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 03 2月, 2014 1 次提交
-
-
由 Pantelis Antoniou 提交于
When attaching a node always clear the detach flag. Without this change the sequence detach, attach fails. Signed-off-by: NPantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 17 1月, 2014 1 次提交
-
-
由 Xiubo Li 提交于
From IEEE 1275, there defined a standard 'status' property indicating the operational status of one device. The 'status' property has four possible values: 'okay/ok', 'disabled', 'fail' and 'fail-xxx'. If it is absent, that means the status of the device is unknown or okay. The __of_device_is_available checks the state of the 'status' property of a device. If the property is absent or set to 'okay/ok', it returns 1. Otherwise it returns 0. While in __of_device_is_available: > status = of_get_property(device, "status", &statlen); > if (status == NULL) > return 1; The status value returned from 'of_get_property()' will be NULL in two cases: Firstly: the 'device' value (device node) is NULL. Secondly: the 'status' property is actaully not exist. If the device node is NULL, the __of_device_is_available will return true, that will mean the absent state of the 'status' property. So this add the device node check before checking the 'status' property's state, and if the device node is not exist, 0 will be returned. Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 05 12月, 2013 1 次提交
-
-
由 Sebastian Hesselbarth 提交于
Currently, of_match_node compares each given match against all node's compatible strings with of_device_is_compatible. To achieve multiple compatible strings per node with ordering from specific to generic, this requires given matches to be ordered from specific to generic. For most of the drivers this is not true and also an alphabetical ordering is more sane there. Therefore, this patch modifies of_match_node to match each of the node's compatible strings against all given matches first, before checking the next compatible string. This implies that node's compatibles are ordered from specific to generic while given matches can be in any order. Signed-off-by: NSebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: NMeelis Roos <mroos@linux.ee> Signed-off-by: NRob Herring <rob.herring@calxeda.com>
-
- 31 10月, 2013 1 次提交
-
-
由 Sudeep KarkadaNagesha 提交于
Since the definition of_find_next_cache_node is architecture independent, the existing definition in powerpc can be moved to driver/of/base.c Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Grant Likely <grant.likely@linaro.org> Cc: Rob Herring <rob.herring@calxeda.com> Signed-off-by: NSudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
-
- 24 10月, 2013 1 次提交
-
-
由 Grant Likely 提交于
It is sometimes useful for debug to get the contents of an of_phandle_args structure out into the kernel log. Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 16 10月, 2013 2 次提交
-
-
由 Grant Likely 提交于
The size of each hwid in a cpu nodes 'reg' property is defined by the parents #address-cells property in the normal way. The cpu parsing code has a bug where it will overrun the end of the property if address-cells is greater than one. This commit fixes the problem by adjusting the array size by the number of address cells. It also makes sure address-cells isn't zero for that would cause an infinite loop. v2: bail if #address-cells is zero instead of forcing to OF_ROOT_NODE_ADDR_CELLS_DEFAULT. Forcing it will cause the reg property to be parsed incorrectly. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-
由 David Miller 提交于
Use for_each_node_by_type() to iterate all cpu nodes in the system. Provide and overridable function arch_find_n_match_cpu_physical_id, which sees if the given device node matches 'cpu' and if so sets '*thread' when non-NULL to the cpu thread number within the core. The default implementation behaves the same as the existing code. Add a sparc64 implementation. Signed-off-by: NDavid S. Miller <davem@davemloft.net> Tested-by: NSudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 14 10月, 2013 1 次提交
-
-
由 Grant Likely 提交于
Not all DT platforms have all the cpus collected under a /cpus node. That just happens to be a details of FDT, ePAPR and PowerPC platforms. Sparc does something different, but unfortunately the current code complains with a warning if /cpus isn't there. This became a problem with commit f86e4718, "driver/core cpu: initialize of_node in cpu's device structure", which caused the function to get called for all architectures. This commit is a temporary fix to fail silently if the cpus node isn't present. A proper fix will come later to allow arch code to provide a custom mechanism for decoding the CPU hwid if the 'reg' property isn't appropriate. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Cc: David Miller <davem@davemloft.net> Cc: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com> Cc: Rob Herring <rob.herring@calxeda.com>
-
- 10 10月, 2013 1 次提交
-
-
由 Rob Herring 提交于
Implement of_node_to_nid as weak function to remove the dependency on asm/prom.h. This is in preparation to make prom.h optional. Signed-off-by: NRob Herring <rob.herring@calxeda.com> Acked-by: NGrant Likely <grant.likely@linaro.org>
-