kbuild: remove unneeded -O option to dtc
authorMasahiro Yamada <masahiroy@kernel.org>
Wed, 10 Mar 2021 11:08:24 +0000 (20:08 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Thu, 11 Mar 2021 05:52:54 +0000 (14:52 +0900)
commit64bfc99429a5c9613fffb0e54f2f8c2ddc8c1d04
tree7a2caf86d02d092ceab0191d2e11c890d48a54a0
parentf9bc754be475582e2cc44296f7de0aaedbdbefeb
kbuild: remove unneeded -O option to dtc

This piece of code converts the target suffix to the dtc -O option:

    *.dtb      ->  -O dtb
    *.dt.yaml  ->  -O yaml

Commit ce88c9c79455 ("kbuild: Add support to build overlays (%.dtbo)")
added the third case:

    *.dtbo     ->  -O dtbo

This works thanks to commit 163f0469bf2e ("dtc: Allow overlays to have
.dtbo extension") in the upstream DTC, which has already been pulled in
the kernel.

However, I think it is a bit odd because "dtbo" is not a format name.
At least, it does not show up in the help message of dtc.

$ scripts/dtc/dtc --help
  [ snip ]
  -O, --out-format <arg>
        Output formats are:
                dts - device tree source text
                dtb - device tree blob
                yaml - device tree encoded as YAML
                asm - assembler source

So, I am not a big fan of the second hunk of that change:

        } else if (streq(outform, "dtbo")) {
                dt_to_blob(outf, dti, outversion);

Anyway, we did not need to do this in Makefile in the first place.

guess_type_by_name() had already understood ".yaml" before commit
4f0e3a57d6eb ("kbuild: Add support for DT binding schema checks"),
and now does ".dtbo" as well.

Makefile does not need to duplicate the same logic. Let's leave it
to dtc.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
scripts/Makefile.lib