[coreboot] patch: allow dts names to end in .dts

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Mon Aug 11 12:22:57 CEST 2008


On 11.08.2008 07:01, ron minnich wrote:
> If a dts name ends in .dts, e.g.
>                                 /config/("southbridge/nvidia/mcp55/ide.dts");
> it will be used. The node label will have the .dts removed.
>
> Attached. Tested on builds and it looks fine. Now you can all stop
> telling me to do this :-)
>
> ron
>   
> Add support for dtc files that end in .dtc, e.g. ide.dtc. 
>
> This is managed by stripping the .dtc from the name when it
> is used to label the node in the tree. 
>
> This one's for you Peter!
>
> Signed-off-by: Ronald G. Minnich <rminnich at gmail.com>

Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

> Index: util/dtc/dtc-parser.y
> ===================================================================
> --- util/dtc/dtc-parser.y	(revision 736)
> +++ util/dtc/dtc-parser.y	(working copy)
> @@ -139,9 +139,17 @@
>  			switchback();
>  			
>  		}
> -		')' ';' { 
> +		')' ';' {
> +				int namelen;
> +				char *name = strdup((char *)$3.val);

Hm. Do we ever free name? That would be a memory leak otherwise.

>  				/* convention: first property is labeled with path */
> -				$6->label = strdup((char *)$3.val);
> +				$6->label = name;
> +
> +				/* convention: if it ends in .dts, strip that off	*/
> +				namelen = strlen($6->label);
> +				if ((namelen > 4) && (! strncmp(&name[namelen-4], ".dts", 4)))
> +					$6->label[namelen-4] = '\0';
> +
>  				$$ = $6
>  			}
>  	|

Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/





More information about the coreboot mailing list