From: Artem Bityutskiy <dedekind1@gmail.com>
To: Amul Kumar Saha <amul.saha@samsung.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
Kyungmin Park <kmpark@infradead.org>,
linux-mtd@lists.infradead.org
Subject: Re: [PATCH] [OneNAND] OTP support re-implementation 1/1
Date: Wed, 02 Sep 2009 09:10:15 +0300 [thread overview]
Message-ID: <4A9E0C47.205@gmail.com> (raw)
In-Reply-To: <C48D93C7DF3C4F9C96E47BE9D6F51F37@sisodomain.com>
On 09/02/2009 08:59 AM, Amul Kumar Saha wrote:
> +if MTD_ONENAND_OTP
> +
> +config ONENAND_OTP_AREA
> + bool "OTP area ONLY"
> + depends on MTD_ONENAND_OTP
> + select ON_OTP_AREA
> +
> +config ONENAND_OTP_BLOCK0
> + bool "Block[0] ONLY"
> + depends on MTD_ONENAND_OTP&& !ONENAND_OTP_AREA
> + select ON_OTP_BLOCK0
> +
> +config ONENAND_OTP_AREA_BLOCK0
> + bool "BOTH OTP area AND Block[0]"
> + depends on MTD_ONENAND_OTP&& !ONENAND_OTP_AREA&& !ONENAND_OTP_BLOCK0
> + select ON_OTP_AREA_BLOCK0
> +
> +endif #MTD_ONENAND_OTP
If there were 10 OTP blocks, would you add 10 options?
I mean, are these switches really needed? Can we remove them?
> +
> config MTD_ONENAND_2X_PROGRAM
> bool "OneNAND 2X program support"
> help
> diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
> index 6e82909..1b11a3e 100644
> --- a/drivers/mtd/onenand/onenand_base.c
> +++ b/drivers/mtd/onenand/onenand_base.c
> @@ -13,6 +13,10 @@
> * Flex-OneNAND support
> * Copyright (C) Samsung Electronics, 2008
> *
> + * Amul Kumar Saha<amul.saha@samsung.com>
> + * OTP support
> + * Copyright (C) SAMSUNG Electronics, 2009
If this all is (C) Samsung already, do you really need to add one more
(C) line?
> + *
> * 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.
> @@ -308,6 +312,81 @@ int flexonenand_region(struct mtd_info *mtd, loff_t addr)
> EXPORT_SYMBOL(flexonenand_region);
>
> /**
> + * onenand_otp_command - Send OTP specific command to OneNAND device
> + * @param mtd MTD device structure
> + * @param cmd the command to be sent
> + * @param addr offset to read from or write to
> + * @param len number of bytes to read or write
> + */
> +static int onenand_otp_command(struct mtd_info *mtd, int cmd, loff_t addr,
> + size_t len)
> +{
> + struct onenand_chip *this = mtd->priv;
> + int value, block, page;
> +
> + /* Address translation */
> + switch (cmd) {
> + case ONENAND_CMD_OTP_ACCESS:
> + block = (int) (addr>> this->erase_shift);
Why do you need the (int) cast there? How about cleaning up
>> (missing space) ?
> + page = -1;
> + break;
> +
> + default:
> + block = (int) (addr>> this->erase_shift);
> + page = (int) (addr>> this->page_shift);
Ditto. And there are many places where you did not have put spaces properly.
> +/**
> * onenand_command - [DEFAULT] Send command to OneNAND device
> * @param mtd MTD device structure
> * @param cmd the command to be sent
> @@ -1879,7 +1958,8 @@ static int onenand_write_ops_nolock(struct mtd_info *mtd, loff_t to,
> onenand_update_bufferram(mtd, prev, !ret&& !prev_subpage);
> if (ret) {
> written -= prevlen;
> - printk(KERN_ERR "onenand_write_ops_nolock: write filaed %d\n", ret);
> + printk(KERN_ERR "onenand_write_ops_nolock: \
> + write failed %d\n", ret);
> break;
Please, fix printk's. Do not use "\".
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
next prev parent reply other threads:[~2009-09-02 6:10 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-17 10:43 [PATCH] [OneNAND] OTP support re-implementation 1/1 Amul Kumar Saha
2009-08-26 5:41 ` Amul Kumar Saha
2009-08-26 5:58 ` Artem Bityutskiy
2009-08-27 6:37 ` Amul Kumar Saha
2009-08-28 13:38 ` Artem Bityutskiy
2009-08-31 9:19 ` Amul Kumar Saha
2009-08-31 9:34 ` Kyungmin Park
2009-09-02 5:55 ` Amul Kumar Saha
2009-09-02 5:59 ` Amul Kumar Saha
2009-09-02 6:10 ` Artem Bityutskiy [this message]
2009-09-03 5:51 ` Amul Kumar Saha
2009-09-03 6:10 ` Artem Bityutskiy
2009-09-03 10:37 ` Amul Kumar Saha
2009-09-03 11:19 ` Artem Bityutskiy
2009-09-07 9:45 ` Amul Kumar Saha
2009-09-07 9:57 ` Kyungmin Park
2009-09-16 3:33 ` Amul Kumar Saha
2009-09-16 6:40 ` Artem Bityutskiy
2009-09-28 9:38 ` Artem Bityutskiy
2009-10-01 6:48 ` Amul Kumar Saha
2009-10-12 4:42 ` Amul Kumar Saha
-- strict thread matches above, loose matches on Subject: below --
2009-10-12 6:01 Amul Kumar Saha
2009-10-20 8:56 ` Artem Bityutskiy
2009-10-20 14:13 ` Adrian Hunter
2009-10-21 11:20 ` Amul Kumar Saha
2009-10-23 6:11 ` Artem Bityutskiy
2009-10-21 11:30 ` Amul Kumar Saha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A9E0C47.205@gmail.com \
--to=dedekind1@gmail.com \
--cc=amul.saha@samsung.com \
--cc=dwmw2@infradead.org \
--cc=kmpark@infradead.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.