public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Bug in mtd_blkdevs-24.c for devfs
@ 2004-06-17 14:41 Andy Hawkins
  0 siblings, 0 replies; only message in thread
From: Andy Hawkins @ 2004-06-17 14:41 UTC (permalink / raw)
  To: linux-mtd

Hi,

I guess people don't generally use a large number of flash devices, but
if there are more than 10, then the devfs entries will be wrong because
of the following lines in add_mtd_blktrans_dev:

                char name[2];

                name[0] = '0' + new->devnum;
                name[1] = 0;

		new->blkcore_priv = 
			devfs_register(tr->blkcore_priv->devfs_dir_handle,
				       name, DEVFS_FL_DEFAULT, 				       tr->major,
				       new->devnum,         				       S_IFBLK|S_IRUGO|S_IWUGO,
				       &mtd_blktrans_ops, NULL);

For any devnum > 9, this will generate a punctuation character. The
following code is more correct (and is the same as in mtdchar.c)

		char name[10];

		sprintf(name,"%d",new->devnum);

		new->blkcore_priv = 
			devfs_register(tr->blkcore_priv->devfs_dir_handle,
				       name, DEVFS_FL_DEFAULT, 				       tr->major,
				       new->devnum,         				       S_IFBLK|S_IRUGO|S_IWUGO,
				       &mtd_blktrans_ops, NULL);

Apologies for the formatting, I can generate a patch if required...

Andy

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-06-17 14:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-17 14:41 Bug in mtd_blkdevs-24.c for devfs Andy Hawkins

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