aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2010-01-29 15:58:23 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-02-25 06:39:09 -0500
commit24c15496771ea1f3902dee23f746042ba34dc2b8 (patch)
treeb9bfd802eff8e6d7405c8714a96a7661c3fa1008 /drivers/mtd
parente99e90aef17517d99be8e049b2f5cc563cd6862a (diff)
mtd: Remove unnecessary comparisons with MAX_MTD_DEVICES
MAX_MTD_DEVICES is about to be removed. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/devices/pmc551.c4
-rw-r--r--drivers/mtd/mtdchar.c3
-rw-r--r--drivers/mtd/mtdoops.c5
3 files changed, 2 insertions, 10 deletions
diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c
index d2fd550f7e09..fc8ea0a57ac2 100644
--- a/drivers/mtd/devices/pmc551.c
+++ b/drivers/mtd/devices/pmc551.c
@@ -668,7 +668,7 @@ static int __init init_pmc551(void)
668{ 668{
669 struct pci_dev *PCI_Device = NULL; 669 struct pci_dev *PCI_Device = NULL;
670 struct mypriv *priv; 670 struct mypriv *priv;
671 int count, found = 0; 671 int found = 0;
672 struct mtd_info *mtd; 672 struct mtd_info *mtd;
673 u32 length = 0; 673 u32 length = 0;
674 674
@@ -695,7 +695,7 @@ static int __init init_pmc551(void)
695 /* 695 /*
696 * PCU-bus chipset probe. 696 * PCU-bus chipset probe.
697 */ 697 */
698 for (count = 0; count < MAX_MTD_DEVICES; count++) { 698 for (;;) {
699 699
700 if ((PCI_Device = pci_get_device(PCI_VENDOR_ID_V3_SEMI, 700 if ((PCI_Device = pci_get_device(PCI_VENDOR_ID_V3_SEMI,
701 PCI_DEVICE_ID_V3_SEMI_V370PDC, 701 PCI_DEVICE_ID_V3_SEMI_V370PDC,
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index bce0a07cbac9..9f826cda2748 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -67,9 +67,6 @@ static int mtd_open(struct inode *inode, struct file *file)
67 67
68 DEBUG(MTD_DEBUG_LEVEL0, "MTD_open\n"); 68 DEBUG(MTD_DEBUG_LEVEL0, "MTD_open\n");
69 69
70 if (devnum >= MAX_MTD_DEVICES)
71 return -ENODEV;
72
73 /* You can't open the RO devices RW */ 70 /* You can't open the RO devices RW */
74 if ((file->f_mode & FMODE_WRITE) && (minor & 1)) 71 if ((file->f_mode & FMODE_WRITE) && (minor & 1))
75 return -EACCES; 72 return -EACCES;
diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index 92e12df0917f..328313c3dccb 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -429,11 +429,6 @@ static int __init mtdoops_init(void)
429 mtd_index = simple_strtoul(mtddev, &endp, 0); 429 mtd_index = simple_strtoul(mtddev, &endp, 0);
430 if (*endp == '\0') 430 if (*endp == '\0')
431 cxt->mtd_index = mtd_index; 431 cxt->mtd_index = mtd_index;
432 if (cxt->mtd_index > MAX_MTD_DEVICES) {
433 printk(KERN_ERR "mtdoops: invalid mtd device number (%u) given\n",
434 mtd_index);
435 return -EINVAL;
436 }
437 432
438 cxt->oops_buf = vmalloc(record_size); 433 cxt->oops_buf = vmalloc(record_size);
439 if (!cxt->oops_buf) { 434 if (!cxt->oops_buf) {