Merge tag 'dm-pull-29oct19' of git://git.denx.de/u-boot-dm
[oweals/u-boot.git] / drivers / spi / ath79_spi.c
index 0c1022da05c3ef2a0c2e9d9f3ba850ce49d025ad..207069218f6ce445728f10570f23df33a29da0cd 100644 (file)
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2015-2016 Wills Wang <wills.wang@live.com>
- *
- * SPDX-License-Identifier: GPL-2.0+
  */
 
 #include <common.h>
@@ -175,21 +174,9 @@ static int ath79_spi_set_mode(struct udevice *bus, uint mode)
 static int ath79_spi_probe(struct udevice *bus)
 {
        struct ath79_spi_priv *priv = dev_get_priv(bus);
-       struct udevice *pinctrl;
        fdt_addr_t addr;
-       int ret;
-
-       ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-       if (ret)
-               return ret;
-       ret = pinctrl_get_periph_id(pinctrl, bus);
-       if (ret < 0)
-               return ret;
-       ret = pinctrl_request(pinctrl, ret, 0);
-       if (ret < 0)
-               return ret;
-
-       addr = dev_get_addr(bus);
+
+       addr = devfdt_get_addr(bus);
        if (addr == FDT_ADDR_T_NONE)
                return -EINVAL;
 
@@ -211,7 +198,7 @@ static int ath79_cs_info(struct udevice *bus, uint cs,
 {
        /* Always allow activity on CS 0/1/2 */
        if (cs >= 3)
-               return -ENODEV;
+               return -EINVAL;
 
        return 0;
 }