From cd24f633a063f0fd2c18f4c584cd43bd609bafbe Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Thu, 23 Apr 2020 22:44:58 +0200 Subject: treewide: remove references to CREDITS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CREDITS file was removed from barebox in 2015 by commit 6570288f2d97 ("Remove the CREDITS file"). Remove references to it from several files. Signed-off-by: Uwe Kleine-König Signed-off-by: Sascha Hauer --- drivers/mtd/core.c | 3 --- drivers/mtd/nand/nand-bb.c | 3 --- drivers/mtd/nor/cfi_flash.c | 3 --- drivers/mtd/nor/cfi_flash.h | 3 --- 4 files changed, 12 deletions(-) (limited to 'drivers/mtd') diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c index 881b5f4864..1625d938ea 100644 --- a/drivers/mtd/core.c +++ b/drivers/mtd/core.c @@ -3,9 +3,6 @@ * 2N Telekomunikace, a.s. * Ladislav Michl * - * 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 * version 2 as published by the Free Software Foundation. diff --git a/drivers/mtd/nand/nand-bb.c b/drivers/mtd/nand/nand-bb.c index e578d72a49..c0104c5936 100644 --- a/drivers/mtd/nand/nand-bb.c +++ b/drivers/mtd/nand/nand-bb.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2008 Sascha Hauer , Pengutronix * - * 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 version 2 * as published by the Free Software Foundation. diff --git a/drivers/mtd/nor/cfi_flash.c b/drivers/mtd/nor/cfi_flash.c index 01ab1aa274..430f926e8c 100644 --- a/drivers/mtd/nor/cfi_flash.c +++ b/drivers/mtd/nor/cfi_flash.c @@ -11,9 +11,6 @@ * Copyright (C) 2006 * Tolunay Orkun * - * 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 diff --git a/drivers/mtd/nor/cfi_flash.h b/drivers/mtd/nor/cfi_flash.h index e82eb28abe..cea6a8712c 100644 --- a/drivers/mtd/nor/cfi_flash.h +++ b/drivers/mtd/nor/cfi_flash.h @@ -5,9 +5,6 @@ * (C) Copyright 2000-2005 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * - * 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 -- cgit v1.2.3 From d9e5eb8ec4dfa70d2a3afb1a326da80ae82c06f0 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 16 Apr 2020 08:18:28 +0200 Subject: ubi: Refuse to attach partitioned mtd devices When a mtd device has partitions it is wrong to attach the whole device as this would corrupt the partitions. Refuse to attach it. Signed-off-by: Sascha Hauer --- drivers/mtd/ubi/build.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/mtd') diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 604fe87e53..da409010f7 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -508,6 +508,14 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, struct ubi_device *ubi; int i, err, ref = 0; + /* + * Do not try to attach an UBI device if this device has partitions + * as it's not a good idea to attach UBI on a raw device when the + * real UBI only spans the first partition. + */ + if (!list_empty(&mtd->partitions)) + return -EBUSY; + if (max_beb_per1024 < 0 || max_beb_per1024 > MAX_MTD_UBI_BEB_LIMIT) return -EINVAL; -- cgit v1.2.3 From f62bb30044dbad752bf0414239f793585d66960c Mon Sep 17 00:00:00 2001 From: Stefan Riedmueller Date: Mon, 4 May 2020 15:21:48 +0200 Subject: mtd: mtdraw: Fix cdev size calculation for large NANDs Raw size for large NAND devices (> 4 GB) can exceed 32 bits, so we need 64 bit types as factors. Both factors are of 32 bit types, as such is the return value. At least one factor needs to be 64 bit type when calculating the size. Signed-off-by: Stefan Riedmueller Signed-off-by: Christian Hemp Signed-off-by: Yunus Bas Signed-off-by: Sascha Hauer --- drivers/mtd/mtdraw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/mtd') diff --git a/drivers/mtd/mtdraw.c b/drivers/mtd/mtdraw.c index f63da7b3b2..b71619244b 100644 --- a/drivers/mtd/mtdraw.c +++ b/drivers/mtd/mtdraw.c @@ -306,7 +306,7 @@ static int add_mtdraw_device(struct mtd_info *mtd, const char *devname, void **p mtdraw->mtd = mtd; mtdraw->cdev.ops = (struct cdev_operations *)&mtd_raw_fops; - mtdraw->cdev.size = mtd_div_by_wb(mtd->size, mtd) * mtdraw->rps; + mtdraw->cdev.size = (loff_t)mtd_div_by_wb(mtd->size, mtd) * mtdraw->rps; mtdraw->cdev.name = basprintf("%s.raw", mtd->cdev.name); mtdraw->cdev.priv = mtdraw; mtdraw->cdev.dev = &mtd->class_dev; -- cgit v1.2.3