X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fmtd%2Fcfi_mtd.c;h=a5bb0962e556937781013210da098aed43e19b8c;hb=83a5df42614c566c3c642871f683e66a53d228ae;hp=cbcc165c7efd4df7fcbfbf4135f8427e337628ad;hpb=b65e86d8d832146600a28cb4f14f771533df4f35;p=oweals%2Fu-boot.git diff --git a/drivers/mtd/cfi_mtd.c b/drivers/mtd/cfi_mtd.c index cbcc165c7e..a5bb0962e5 100644 --- a/drivers/mtd/cfi_mtd.c +++ b/drivers/mtd/cfi_mtd.c @@ -1,33 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2008 Semihalf * * Written by: Piotr Ziecik - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * */ #include #include #include -#include +#include #include #include #include @@ -222,8 +204,10 @@ int cfi_mtd_init(void) struct mtd_info *mtd; flash_info_t *fi; int error, i; +#ifdef CONFIG_MTD_CONCAT int devices_found = 0; struct mtd_info *mtd_list[CONFIG_SYS_MAX_FLASH_BANKS]; +#endif for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) { fi = &flash_info[i]; @@ -241,19 +225,22 @@ int cfi_mtd_init(void) mtd->flags = MTD_CAP_NORFLASH; mtd->size = fi->size; mtd->writesize = 1; - - mtd->erase = cfi_mtd_erase; - mtd->read = cfi_mtd_read; - mtd->write = cfi_mtd_write; - mtd->sync = cfi_mtd_sync; - mtd->lock = cfi_mtd_lock; - mtd->unlock = cfi_mtd_unlock; + mtd->writebufsize = mtd->writesize; + + mtd->_erase = cfi_mtd_erase; + mtd->_read = cfi_mtd_read; + mtd->_write = cfi_mtd_write; + mtd->_sync = cfi_mtd_sync; + mtd->_lock = cfi_mtd_lock; + mtd->_unlock = cfi_mtd_unlock; mtd->priv = fi; if (add_mtd_device(mtd)) return -ENOMEM; +#ifdef CONFIG_MTD_CONCAT mtd_list[devices_found++] = mtd; +#endif } #ifdef CONFIG_MTD_CONCAT