public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Adding a function pointer to mtd_info struct
@ 2008-01-23 17:28 Justin Treon
  2008-01-23 22:13 ` Josh Boyer
  0 siblings, 1 reply; 3+ messages in thread
From: Justin Treon @ 2008-01-23 17:28 UTC (permalink / raw)
  To: linux-mtd

I am trying to add some new features in my kernel to cfi_cmd_0001.c for a test chip.
 I added a new field to the mtd_info struct in mtd.h and inserted the function
pointer into the mtd->overwrite field I added in cfi_cmd_0001.c, but when I try to
use mtd->overwrite in mtdblock.c the pointer is set to NULL.  

In the mtd_info struct in include/mtd/mtd.h I addded:
	int (*overwrite) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
const u_char *buf);

In cfi_cmd_0001.c I added:
	mtd->overwrite = cfi_intelext_overwrite_buffers;

What file or field do I need to modify to make new function accessible from
mtdblock.c?

Justin Treon



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Adding a function pointer to mtd_info struct
  2008-01-23 17:28 Adding a function pointer to mtd_info struct Justin Treon
@ 2008-01-23 22:13 ` Josh Boyer
  2008-01-24  0:43   ` Justin Treon
  0 siblings, 1 reply; 3+ messages in thread
From: Josh Boyer @ 2008-01-23 22:13 UTC (permalink / raw)
  To: Justin Treon; +Cc: linux-mtd

On Wed, 23 Jan 2008 09:28:13 -0800 (PST)
Justin Treon <justin_treon@yahoo.com> wrote:

> I am trying to add some new features in my kernel to cfi_cmd_0001.c for a test chip.
>  I added a new field to the mtd_info struct in mtd.h and inserted the function
> pointer into the mtd->overwrite field I added in cfi_cmd_0001.c, but when I try to
> use mtd->overwrite in mtdblock.c the pointer is set to NULL.  
> 
> In the mtd_info struct in include/mtd/mtd.h I addded:
> 	int (*overwrite) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
> const u_char *buf);
> 
> In cfi_cmd_0001.c I added:
> 	mtd->overwrite = cfi_intelext_overwrite_buffers;
> 
> What file or field do I need to modify to make new function accessible from
> mtdblock.c?

Just post a patch of what you did.  It'll be easier to help you.

josh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Adding a function pointer to mtd_info struct
  2008-01-23 22:13 ` Josh Boyer
@ 2008-01-24  0:43   ` Justin Treon
  0 siblings, 0 replies; 3+ messages in thread
From: Justin Treon @ 2008-01-24  0:43 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linux-mtd

> > I am trying to add some new features in my kernel to cfi_cmd_0001.c for a test
> chip.
> >  I added a new field to the mtd_info struct in mtd.h and inserted the function
> > pointer into the mtd->overwrite field I added in cfi_cmd_0001.c, but when I try
> to
> > use mtd->overwrite in mtdblock.c the pointer is set to NULL.  
> > 
> > In the mtd_info struct in include/mtd/mtd.h I addded:
> > 	int (*overwrite) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
> > const u_char *buf);
> > 
> > In cfi_cmd_0001.c I added:
> > 	mtd->overwrite = cfi_intelext_overwrite_buffers;
> > 
> > What file or field do I need to modify to make new function accessible from
> > mtdblock.c?
> 
> Just post a patch of what you did.  It'll be easier to help you.
> 

I figured it out.  I did not realize I had to edit the mtd-parts file as well. Thank
you Josh.

Justin



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-24  0:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-23 17:28 Adding a function pointer to mtd_info struct Justin Treon
2008-01-23 22:13 ` Josh Boyer
2008-01-24  0:43   ` Justin Treon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox