X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fspi%2Fdesignware_spi.c;h=5aa507b2d8b2a70736a5eb9076b899c9ddf27b6d;hb=a89302cc7908de36e949b02013ac05ce5ef8b354;hp=86ee90f4be50f796550ed17437d68b357f0ba861;hpb=b7e84c93c450480ca4ff51ad2eb56bd83c1dc368;p=oweals%2Fu-boot.git diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c index 86ee90f4be..5aa507b2d8 100644 --- a/drivers/spi/designware_spi.c +++ b/drivers/spi/designware_spi.c @@ -74,14 +74,14 @@ DECLARE_GLOBAL_DATA_PTR; #define SPI_CFS_OFFSET 12 /* Bit fields in SR, 7 bits */ -#define SR_MASK 0x7f /* cover 7 bits */ -#define SR_BUSY (1 << 0) -#define SR_TF_NOT_FULL (1 << 1) -#define SR_TF_EMPT (1 << 2) -#define SR_RF_NOT_EMPT (1 << 3) -#define SR_RF_FULL (1 << 4) -#define SR_TX_ERR (1 << 5) -#define SR_DCOL (1 << 6) +#define SR_MASK GENMASK(6, 0) /* cover 7 bits */ +#define SR_BUSY BIT(0) +#define SR_TF_NOT_FULL BIT(1) +#define SR_TF_EMPT BIT(2) +#define SR_RF_NOT_EMPT BIT(3) +#define SR_RF_FULL BIT(4) +#define SR_TX_ERR BIT(5) +#define SR_DCOL BIT(6) #define RX_TIMEOUT 1000 /* timeout in ms */ @@ -132,9 +132,9 @@ 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 = bus->of_offset; + int node = dev_of_offset(bus); - plat->regs = (struct dw_spi *)dev_get_addr(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",