|
@@ -249,7 +249,7 @@ static void __exit ali_ircc_cleanup(void)
|
|
|
|
|
|
IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
|
|
|
|
|
|
- for (i=0; i < 4; i++) {
|
|
|
+ for (i=0; i < ARRAY_SIZE(dev_self); i++) {
|
|
|
if (dev_self[i])
|
|
|
ali_ircc_close(dev_self[i]);
|
|
|
}
|
|
@@ -273,6 +273,12 @@ static int ali_ircc_open(int i, chipio_t *info)
|
|
|
int err;
|
|
|
|
|
|
IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
|
|
|
+
|
|
|
+ if (i >= ARRAY_SIZE(dev_self)) {
|
|
|
+ IRDA_ERROR("%s(), maximum number of supported chips reached!\n",
|
|
|
+ __FUNCTION__);
|
|
|
+ return -ENOMEM;
|
|
|
+ }
|
|
|
|
|
|
/* Set FIR FIFO and DMA Threshold */
|
|
|
if ((ali_ircc_setup(info)) == -1)
|