X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fspi%2Fdesignware_spi.c;h=7d58cfae55e417d1766069111f2ab963d434e6dc;hb=0c9cc5155cb5027ae17ace986f349e2f0d1fb9a3;hp=02d93763d42d8003e485dfaa16ce3f4ea91e0e24;hpb=5c676780e116dc79c1819d6c49a2aa53e1053e04;p=oweals%2Fu-boot.git diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c index 02d93763d4..7d58cfae55 100644 --- a/drivers/spi/designware_spi.c +++ b/drivers/spi/designware_spi.c @@ -9,8 +9,8 @@ * Copyright (c) 2009, Intel Corporation. */ -#include #include +#include #include #include #include @@ -22,8 +22,6 @@ #include #include -DECLARE_GLOBAL_DATA_PTR; - /* Register offsets */ #define DW_SPI_CTRL0 0x00 #define DW_SPI_CTRL1 0x04 @@ -155,14 +153,12 @@ static int request_gpio_cs(struct udevice *bus) static int dw_spi_ofdata_to_platdata(struct udevice *bus) { struct dw_spi_platdata *plat = bus->platdata; - const void *blob = gd->fdt_blob; - int node = dev_of_offset(bus); plat->regs = (struct dw_spi *)devfdt_get_addr(bus); /* Use 500KHz as a suitable default */ - plat->frequency = fdtdec_get_int(blob, node, "spi-max-frequency", - 500000); + plat->frequency = dev_read_u32_default(bus, "spi-max-frequency", + 500000); debug("%s: regs=%p max-frequency=%d\n", __func__, plat->regs, plat->frequency);