Skip to content
Snippets Groups Projects
Commit 375d7e92 authored by Stefano Babic's avatar Stefano Babic
Browse files

spi: mxc_spi: fix warnings if CLK_ENABLED not set


Following warnings (unused variables) are raised:

drivers/spi/mxc_spi.c: In function 'mxc_spi_probe':
drivers/spi/mxc_spi.c:595:14: error: unused variable 'blob' [-Werror=unused-variable]
595 |  const void *blob = gd->fdt_blob;
    |              ^~~~
drivers/spi/mxc_spi.c:594:6: error: unused variable 'node' [-Werror=unused-variable]
594 |  int node = dev_of_offset(bus);

Move the variable declaration inside the code where they are used.

Signed-off-by: default avatarStefano Babic <sbabic@denx.de>
parent 55d46761
No related branches found
No related tags found
No related merge requests found
......@@ -591,8 +591,6 @@ void spi_release_bus(struct spi_slave *slave)
static int mxc_spi_probe(struct udevice *bus)
{
struct mxc_spi_slave *mxcs = dev_get_plat(bus);
int node = dev_of_offset(bus);
const void *blob = gd->fdt_blob;
int ret;
int i;
......@@ -629,6 +627,8 @@ static int mxc_spi_probe(struct udevice *bus)
mxcs->max_hz = clk_get_rate(&clk);
#else
int node = dev_of_offset(bus);
const void *blob = gd->fdt_blob;
mxcs->max_hz = fdtdec_get_int(blob, node, "spi-max-frequency",
20000000);
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment