]> git.sur5r.net Git - u-boot/blobdiff - drivers/spi/spi-uclass.c
tpm: prepare support for TPMv2.x commands
[u-boot] / drivers / spi / spi-uclass.c
index 6db0eb02b4a51ff471cf85324b1aa752eb2319e3..d2d091f5ea19b80c375115ec105db3a0fc098223 100644 (file)
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (c) 2014 Google, Inc
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -50,7 +49,6 @@ int dm_spi_claim_bus(struct udevice *dev)
        struct dm_spi_bus *spi = dev_get_uclass_priv(bus);
        struct spi_slave *slave = dev_get_parent_priv(dev);
        int speed;
-       int ret;
 
        speed = slave->max_hz;
        if (spi->max_hz) {
@@ -62,7 +60,8 @@ int dm_spi_claim_bus(struct udevice *dev)
        if (!speed)
                speed = 100000;
        if (speed != slave->speed) {
-               ret = spi_set_speed_mode(bus, speed, slave->mode);
+               int ret = spi_set_speed_mode(bus, speed, slave->mode);
+
                if (ret)
                        return ret;
                slave->speed = speed;
@@ -129,7 +128,6 @@ static int spi_post_probe(struct udevice *bus)
 #if defined(CONFIG_NEEDS_MANUAL_RELOC)
        struct dm_spi_ops *ops = spi_get_ops(bus);
 
-
        if (ops->claim_bus)
                ops->claim_bus += gd->reloc_off;
        if (ops->release_bus)