X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fmtd%2Fpic32_flash.c;h=5c55f1557f5c7b149cd2fc15f93be0d65c085a86;hb=427ddd84204cc0693e3f80f90f257b3d24b04307;hp=8ed7874cc9f73523f34a1a9a37fedf3f7002d8c8;hpb=e1a71f8b339220fa74c9cd5d36ae9c444c492e83;p=oweals%2Fu-boot.git diff --git a/drivers/mtd/pic32_flash.c b/drivers/mtd/pic32_flash.c index 8ed7874cc9..5c55f1557f 100644 --- a/drivers/mtd/pic32_flash.c +++ b/drivers/mtd/pic32_flash.c @@ -1,9 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2015 * Cristian Birsan * Purna Chandra Mandal - * - * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -66,10 +65,10 @@ static inline void flash_initiate_operation(u32 nvmop) static int flash_wait_till_busy(const char *func, ulong timeout) { - int ret = wait_for_bit(__func__, &nvm_regs_p->ctrl.raw, - NVM_WR, false, timeout, false); + int ret = wait_for_bit_le32(&nvm_regs_p->ctrl.raw, + NVM_WR, false, timeout, false); - return ret ? ERR_TIMOUT : ERR_OK; + return ret ? ERR_TIMEOUT : ERR_OK; } static inline int flash_complete_operation(void) @@ -99,7 +98,7 @@ static inline int flash_complete_operation(void) * Erase flash sectors, returns: * ERR_OK - OK * ERR_INVAL - invalid sector arguments - * ERR_TIMOUT - write timeout + * ERR_TIMEOUT - write timeout * ERR_NOT_ERASED - Flash not erased * ERR_UNKNOWN_FLASH_VENDOR - incorrect flash */ @@ -217,7 +216,7 @@ static int write_word(flash_info_t *info, ulong dest, ulong word) /* * Copy memory to flash, returns: * ERR_OK - OK - * ERR_TIMOUT - write timeout + * ERR_TIMEOUT - write timeout * ERR_NOT_ERASED - Flash not erased */ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt) @@ -384,7 +383,7 @@ static int pic32_flash_probe(struct udevice *dev) * match with reg-names. */ parent = fdt_parent_offset(blob, node); - of_bus_default_count_cells(blob, parent, &addrc, &sizec); + fdt_support_default_count_cells(blob, parent, &addrc, &sizec); list = fdt_getprop(blob, node, "reg-names", &len); if (!list) return -ENOENT;