* [PATCH] mtd: nand: restore useage of ONFI reported bus width
@ 2011-10-03 6:57 Hitz, Christian
2011-10-03 9:35 ` Florian Fainelli
0 siblings, 1 reply; 3+ messages in thread
From: Hitz, Christian @ 2011-10-03 6:57 UTC (permalink / raw)
To: linux-mtd@lists.infradead.org
This patch changes the nand_flash_detect_onfi() function to pass
the NAND bus width it discovered via ONFI back to the caller.
Signed-off-by: Christian Hitz <christian.hitz@aizo.com>
---
drivers/mtd/nand/nand_base.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index a46e9bb..6dae9a0 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2829,7 +2829,7 @@ static u16 onfi_crc16(u16 crc, u8 const *p, size_t len)
* Check if the NAND chip is ONFI compliant, returns 1 if it is, 0 otherwise
*/
static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
- int busw)
+ int *busw)
{
struct nand_onfi_params *p = &chip->onfi_params;
int i;
@@ -2884,9 +2884,9 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
- busw = 0;
+ *busw = 0;
if (le16_to_cpu(p->features) & 1)
- busw = NAND_BUSWIDTH_16;
+ *busw = NAND_BUSWIDTH_16;
chip->options &= ~NAND_CHIPOPTIONS_MSK;
chip->options |= (NAND_NO_READRDY |
@@ -2952,7 +2952,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
chip->onfi_version = 0;
if (!type->name || !type->pagesize) {
/* Check is chip is ONFI compliant */
- ret = nand_flash_detect_onfi(mtd, chip, busw);
+ ret = nand_flash_detect_onfi(mtd, chip, &busw);
if (ret)
goto ident_done;
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: nand: restore useage of ONFI reported bus width
2011-10-03 6:57 [PATCH] mtd: nand: restore useage of ONFI reported bus width Hitz, Christian
@ 2011-10-03 9:35 ` Florian Fainelli
2011-10-03 19:22 ` Brian Norris
0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2011-10-03 9:35 UTC (permalink / raw)
To: linux-mtd; +Cc: Brian Norris, Hitz, Christian
On Monday 03 October 2011 08:57:59 Hitz, Christian wrote:
> This patch changes the nand_flash_detect_onfi() function to pass
> the NAND bus width it discovered via ONFI back to the caller.
>
> Signed-off-by: Christian Hitz <christian.hitz@aizo.com>
Acked-by: Florian Fainelli <ffainelli@freebox.fr>
> ---
> drivers/mtd/nand/nand_base.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
I though Brian had already submitted a fix for this.
>
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index a46e9bb..6dae9a0 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -2829,7 +2829,7 @@ static u16 onfi_crc16(u16 crc, u8 const *p, size_t
> len) * Check if the NAND chip is ONFI compliant, returns 1 if it is, 0
> otherwise */
> static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip
> *chip, - int busw)
> + int *busw)
> {
> struct nand_onfi_params *p = &chip->onfi_params;
> int i;
> @@ -2884,9 +2884,9 @@ static int nand_flash_detect_onfi(struct mtd_info
> *mtd, struct nand_chip *chip, mtd->erasesize =
> le32_to_cpu(p->pages_per_block) * mtd->writesize; mtd->oobsize =
> le16_to_cpu(p->spare_bytes_per_page);
> chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) *
> mtd->erasesize; - busw = 0;
> + *busw = 0;
> if (le16_to_cpu(p->features) & 1)
> - busw = NAND_BUSWIDTH_16;
> + *busw = NAND_BUSWIDTH_16;
>
> chip->options &= ~NAND_CHIPOPTIONS_MSK;
> chip->options |= (NAND_NO_READRDY |
> @@ -2952,7 +2952,7 @@ static struct nand_flash_dev
> *nand_get_flash_type(struct mtd_info *mtd, chip->onfi_version = 0;
> if (!type->name || !type->pagesize) {
> /* Check is chip is ONFI compliant */
> - ret = nand_flash_detect_onfi(mtd, chip, busw);
> + ret = nand_flash_detect_onfi(mtd, chip, &busw);
> if (ret)
> goto ident_done;
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: nand: restore useage of ONFI reported bus width
2011-10-03 9:35 ` Florian Fainelli
@ 2011-10-03 19:22 ` Brian Norris
0 siblings, 0 replies; 3+ messages in thread
From: Brian Norris @ 2011-10-03 19:22 UTC (permalink / raw)
To: Florian Fainelli; +Cc: linux-mtd, Hitz, Christian
On Mon, Oct 3, 2011 at 2:35 AM, Florian Fainelli <ffainelli@freebox.fr> wrote:
> On Monday 03 October 2011 08:57:59 Hitz, Christian wrote:
>> This patch changes the nand_flash_detect_onfi() function to pass
>> the NAND bus width it discovered via ONFI back to the caller.
>>
>> Signed-off-by: Christian Hitz <christian.hitz@aizo.com>
>
> Acked-by: Florian Fainelli <ffainelli@freebox.fr>
>
>> ---
>> drivers/mtd/nand/nand_base.c | 8 ++++----
>> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> I though Brian had already submitted a fix for this.
No, it was Matthieu CASTET (I Acked). It's already queued for the next
release; you can find it in l2-mtd-2.6.git:
http://git.infradead.org/users/dedekind/l2-mtd-2.6.git
Thanks for the submission though!
Brian
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-03 19:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-03 6:57 [PATCH] mtd: nand: restore useage of ONFI reported bus width Hitz, Christian
2011-10-03 9:35 ` Florian Fainelli
2011-10-03 19:22 ` Brian Norris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox