Skip to content

Commit

Permalink
docs/zh_CN: add dt changesets translation
Browse files Browse the repository at this point in the history
Translate .../devicetree/changesets.rst into Chinese.

Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
Reviewed-by: Alex Shi <alexs@kernel.org>
Link: https://lore.kernel.org/r/07d23cedda1e2cd8cf40d68059024d116f8d004e.1662449105.git.siyanteng@loongson.cn
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
  • Loading branch information
Yanteng Si authored and Jonathan Corbet committed Sep 27, 2022
1 parent 980309d commit 330f5a3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
37 changes: 37 additions & 0 deletions Documentation/translations/zh_CN/devicetree/changesets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.. SPDX-License-Identifier: GPL-2.0
.. include:: ../disclaimer-zh_CN.rst

:Original: Documentation/Devicetree/changesets.rst

:翻译:

司延腾 Yanteng Si <siyanteng@loongson.cn>

:校译:


============
设备树变更集
============

设备树变更集是一种方法,它允许人们以这样一种方式在实时树中使用变化,即要么使用全部的
变化,要么不使用。如果在使用变更集的过程中发生错误,那么树将被回滚到之前的状态。一个
变更集也可以在使用后被删除。

当一个变更集被使用时,所有的改变在发出OF_RECONFIG通知器之前被一次性使用到树上。这是
为了让接收者在收到通知时看到一个完整的、一致的树的状态。

一个变化集的顺序如下。

1. of_changeset_init() - 初始化一个变更集。

2. 一些DT树变化的调用,of_changeset_attach_node(), of_changeset_detach_node(),
of_changeset_add_property(), of_changeset_remove_property,
of_changeset_update_property()来准备一组变更。此时不会对活动树做任何变更。所有
的变更操作都记录在of_changeset的 `entries` 列表中。

3. of_changeset_apply() - 将变更使用到树上。要么整个变更集被使用,要么如果有错误,
树会被恢复到之前的状态。核心通过锁确保正确的顺序。如果需要的话,可以使用一个解锁的
__of_changeset_apply版本。

如果一个成功使用的变更集需要被删除,可以用of_changeset_revert()来完成。
3 changes: 2 additions & 1 deletion Documentation/translations/zh_CN/devicetree/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ Devicetree Overlays
.. toctree::
:maxdepth: 1

changesets

Todolist:

* changesets
* dynamic-resolution-notes
* overlay-notes

Expand Down

0 comments on commit 330f5a3

Please sign in to comment.