public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] kdev_t updates
@ 2002-01-21 16:11 Clive Davies
  2002-01-21 17:02 ` David Woodhouse
  0 siblings, 1 reply; 3+ messages in thread
From: Clive Davies @ 2002-01-21 16:11 UTC (permalink / raw)
  To: linux-mtd

The type definition of kdev_t has changed in 2.5.2. This patch updates 
a couple of files to reflect this. If its Ok, then I'll check it in.

diff -purN linux_2.5.2-rmk1/fs/jffs/inode-v23.c linux/fs/jffs/inode-v23.c
--- linux_2.5.2-rmk1/fs/jffs/inode-v23.c	Fri Jan  4 17:42:12 2002
+++ linux/fs/jffs/inode-v23.c	Wed Jan 16 10:42:18 2002
@@ -357,7 +357,7 @@ jffs_new_inode(const struct inode * dir,
 	inode->i_nlink = raw_inode->nlink;
 	inode->i_uid = raw_inode->uid;
 	inode->i_gid = raw_inode->gid;
-	inode->i_rdev = 0;
+	inode->i_rdev = NODEV;
 	inode->i_size = raw_inode->dsize;
 	inode->i_atime = raw_inode->atime;
 	inode->i_mtime = raw_inode->mtime;
diff -purN linux_2.5.2-rmk1/fs/jffs/jffs_fm.c linux/fs/jffs/jffs_fm.c
--- linux_2.5.2-rmk1/fs/jffs/jffs_fm.c	Wed Jan 16 09:06:59 2002
+++ linux/fs/jffs/jffs_fm.c	Wed Jan 16 10:41:21 2002
@@ -46,7 +46,7 @@ jffs_build_begin(struct jffs_control *c,
 	}
 	DJM(no_jffs_fmcontrol++);
 
-	mtd = get_mtd_device(NULL, MINOR(dev));
+	mtd = get_mtd_device(NULL, minor(dev));
 
 	if (!mtd) {
 		kfree(fmc);

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

* Re: [PATCH] kdev_t updates
  2002-01-21 16:11 [PATCH] kdev_t updates Clive Davies
@ 2002-01-21 17:02 ` David Woodhouse
  2002-01-22  9:57   ` Clive Davies
  0 siblings, 1 reply; 3+ messages in thread
From: David Woodhouse @ 2002-01-21 17:02 UTC (permalink / raw)
  To: Clive Davies; +Cc: linux-mtd

cdavies@altera.com said:
>  The type definition of kdev_t has changed in 2.5.2. This patch
> updates  a couple of files to reflect this. If its Ok, then I'll check
> it in.

Can you couple it with the appropriate magic in include/linux/compatmac.h 
and make sure that's included from the affected files?

Something like this ought to do it:

#if LINUX_KERNEL_CODE < KERNEL_VERSION(2,5,1)
#define minor(x) MINOR(x)
#define major(x) MAJOR(x)
#define NODEV 0
#else
#define to_kdev_t(x) (x)
#endif

--
dwmw2

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

* Re: [PATCH] kdev_t updates
  2002-01-21 17:02 ` David Woodhouse
@ 2002-01-22  9:57   ` Clive Davies
  0 siblings, 0 replies; 3+ messages in thread
From: Clive Davies @ 2002-01-22  9:57 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linux-mtd

> Something like this ought to do it:
>
> #if LINUX_KERNEL_CODE < KERNEL_VERSION(2,5,1)
> #define minor(x) MINOR(x)
> #define major(x) MAJOR(x)
> #define NODEV 0
> #else
> #define to_kdev_t(x) (x)
> #endif

Ok, done. I used 

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,2)
#define minor(x) MINOR(x)
#define major(x) MAJOR(x)
#endif

as to_kdev_t & NODEV are appropriately defined in kdev_t.h before and after 
2.5.2

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

end of thread, other threads:[~2002-01-22  9:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-21 16:11 [PATCH] kdev_t updates Clive Davies
2002-01-21 17:02 ` David Woodhouse
2002-01-22  9:57   ` Clive Davies

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