From: Clive Davies <cdavies@altera.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org
Subject: Re: add_mtd_partition question
Date: Wed, 10 Jul 2002 09:22:47 +0100 [thread overview]
Message-ID: <200207100822.g6A8Mln08290@localhost.localdomain> (raw)
In-Reply-To: <10107.1026288727@redhat.com>
> Please resend after
> echo "diff -up" >> ~/.cvsrc
Index: mtdpart.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/mtdpart.c,v
retrieving revision 1.27
diff -u -p -r1.27 mtdpart.c
--- mtdpart.c 8 Mar 2002 16:34:35 -0000 1.27
+++ mtdpart.c 10 Jul 2002 08:22:04 -0000
@@ -70,6 +70,22 @@ static int part_read_oob (struct mtd_inf
len, retlen, buf);
}
+static int part_read_user_prot_reg (struct mtd_info *mtd, loff_t from,
size_t len,
+ size_t *retlen, u_char *buf)
+{
+ struct mtd_part *part = PART(mtd);
+ return part->master->read_user_prot_reg (part->master, from,
+ len, retlen, buf);
+}
+
+static int part_read_fact_prot_reg (struct mtd_info *mtd, loff_t from,
size_t len,
+ size_t *retlen, u_char *buf)
+{
+ struct mtd_part *part = PART(mtd);
+ return part->master->read_user_prot_reg (part->master, from,
+ len, retlen, buf);
+}
+
static int part_write (struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{
@@ -98,6 +114,14 @@ static int part_write_oob (struct mtd_in
len, retlen, buf);
}
+static int part_write_user_prot_reg (struct mtd_info *mtd, loff_t from,
size_t len,
+ size_t *retlen, u_char *buf)
+{
+ struct mtd_part *part = PART(mtd);
+ return part->master->write_user_prot_reg (part->master, from,
+ len, retlen, buf);
+}
+
static int part_writev (struct mtd_info *mtd, const struct iovec *vecs,
unsigned long count, loff_t to, size_t *retlen)
{
@@ -226,9 +250,6 @@ int add_mtd_partitions(struct mtd_info *
slave->mtd.oobsize = master->oobsize;
slave->mtd.ecctype = master->ecctype;
slave->mtd.eccsize = master->eccsize;
- slave->mtd.read_user_prot_reg = master->read_user_prot_reg;
- slave->mtd.read_fact_prot_reg = master->read_fact_prot_reg;
- slave->mtd.write_user_prot_reg = master->write_user_prot_reg;
slave->mtd.name = parts[i].name;
slave->mtd.bank_size = master->bank_size;
@@ -241,6 +262,12 @@ int add_mtd_partitions(struct mtd_info *
slave->mtd.read_oob = part_read_oob;
if (master->write_oob)
slave->mtd.write_oob = part_write_oob;
+ if(master->read_user_prot_reg)
+ slave->mtd.read_user_prot_reg =
part_read_user_prot_reg;
+ if(master->read_fact_prot_reg)
+ slave->mtd.read_fact_prot_reg =
part_read_fact_prot_reg;
+ if(master->write_user_prot_reg)
+ slave->mtd.write_user_prot_reg =
part_write_user_prot_reg;
if (master->sync)
slave->mtd.sync = part_sync;
if (!i && master->suspend && master->resume) {
next prev parent reply other threads:[~2002-07-10 8:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-09 10:32 add_mtd_partition question Clive Davies
2002-07-09 12:18 ` David Woodhouse
2002-07-09 13:40 ` Clive Davies
2002-07-10 7:23 ` Clive Davies
2002-07-10 8:12 ` David Woodhouse
2002-07-10 8:22 ` Clive Davies [this message]
2002-07-10 8:24 ` David Woodhouse
-- strict thread matches above, loose matches on Subject: below --
2002-07-05 7:58 Clive Davies
2002-07-05 7:32 Clive Davies
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=200207100822.g6A8Mln08290@localhost.localdomain \
--to=cdavies@altera.com \
--cc=dwmw2@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox