Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put comments in device tree source files

How do i put multiline or single line comments in device tree source files. I couldn't find it anywhere. Does the default c way of using comments work?

like image 674
mdsingh Avatar asked Feb 19 '14 04:02

mdsingh


2 Answers

Here is what devicetree documentation says:

The format of the .dts "source" file is "C" like, supports C and C++ style comments.

So you can use both

/* multiline (C style)
   comments */

and

// single line (C++ style) comments,

although the latter is not commonly used for some reason.

like image 132
il--ya Avatar answered Oct 26 '22 00:10

il--ya


Does the default c way of using comments work?

Yes, use /* comment */.


ADDENDUM

I've also used C preprocessor #if 0 and #endif directives to quickly disable (or enable) multiple lines of a node during testing.
I have not seen any conditional directives in DT files elsewhere, so such use may be frowned upon.

like image 44
sawdust Avatar answered Oct 26 '22 00:10

sawdust