aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hamradio/baycom_ser_fdx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/hamradio/baycom_ser_fdx.c')
-rw-r--r--drivers/net/hamradio/baycom_ser_fdx.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c
index 30baf6ecfc63..17ac6975d70d 100644
--- a/drivers/net/hamradio/baycom_ser_fdx.c
+++ b/drivers/net/hamradio/baycom_ser_fdx.c
@@ -415,11 +415,18 @@ static int ser12_open(struct net_device *dev)
415 415
416 if (!dev || !bc) 416 if (!dev || !bc)
417 return -ENXIO; 417 return -ENXIO;
418 if (!dev->base_addr || dev->base_addr > 0x1000-SER12_EXTENT || 418 if (!dev->base_addr || dev->base_addr > 0xffff-SER12_EXTENT ||
419 dev->irq < 2 || dev->irq > 15) 419 dev->irq < 2 || dev->irq > NR_IRQS) {
420 printk(KERN_INFO "baycom_ser_fdx: invalid portnumber (max %u) "
421 "or irq (2 <= irq <= %d)\n",
422 0xffff-SER12_EXTENT, NR_IRQS);
420 return -ENXIO; 423 return -ENXIO;
421 if (bc->baud < 300 || bc->baud > 4800) 424 }
425 if (bc->baud < 300 || bc->baud > 4800) {
426 printk(KERN_INFO "baycom_ser_fdx: invalid baudrate "
427 "(300...4800)\n");
422 return -EINVAL; 428 return -EINVAL;
429 }
423 if (!request_region(dev->base_addr, SER12_EXTENT, "baycom_ser_fdx")) { 430 if (!request_region(dev->base_addr, SER12_EXTENT, "baycom_ser_fdx")) {
424 printk(KERN_WARNING "BAYCOM_SER_FSX: I/O port 0x%04lx busy \n", 431 printk(KERN_WARNING "BAYCOM_SER_FSX: I/O port 0x%04lx busy \n",
425 dev->base_addr); 432 dev->base_addr);