Skip to content

Commit

Permalink
config: zynq-common: Fix attr_val attr_name
Browse files Browse the repository at this point in the history
Reorder the operations for attr_val and check that the values are valid
before applying the changes.

Signed-off-by: Mircea Caprioru <mircea.caprioru@analog.com>
  • Loading branch information
Mircea Caprioru committed Mar 18, 2021
1 parent 8b44bd8 commit 19b59bd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions include/configs/zynq-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,16 @@
"if test \"${refclk_source}\" = \"internal\" && test \"${model}\" = \"Analog Devices PlutoSDR Rev.C (Z7010/AD9363)\" ; then " \
"fdt rm /amba/gpio@e000a000/clock_extern_en; " \
"fi; " \
"if test -n \"${attr_name}\" && test -n \"${attr_val}\"; then " \
"fdt set /amba/spi@e0006000/ad9361-phy@0 ${attr_name} ${attr_val}; " \
"fi; " \
"if test \"${refclk_source}\" = \"external\" && test \"${model}\" = \"Analog Devices PlutoSDR Rev.C (Z7010/AD9363)\" ; then " \
"fdt rm /amba/gpio@e000a000/clock_internal_en; " \
"fi; " \
"if test \"${attr_val}\" = \"ad9361\" && test ! \"${model}\" = \"Analog Devices PlutoSDR Rev.C (Z7010/AD9363)\" ; then " \
"setenv attr_val ad9363a; " \
"saveenv; " \
"fi; " \
"if test -n \"${attr_name}\" && test -n \"${attr_val}\"; then " \
"fdt set /amba/spi@e0006000/ad9361-phy@0 ${attr_name} ${attr_val}; " \
"fi; " \
"if test -n \"${compatible}\" && test ! \"${compatible}\" = \"ad9361\" && test ! \"${compatible}\" = \"ad9363a\" && test ! \"${compatible}\" = \"ad9364\"; then " \
"setenv compatible ad9363a; " \
"saveenv; " \
Expand Down

0 comments on commit 19b59bd

Please sign in to comment.