diff options
Diffstat (limited to 'drivers/parport')
-rw-r--r-- | drivers/parport/parport_pc.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index 9302b8fd7461..d5890027f8af 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c | |||
@@ -3126,9 +3126,9 @@ parport_pc_find_isa_ports (int autoirq, int autodma) | |||
3126 | * autoirq is PARPORT_IRQ_NONE, PARPORT_IRQ_AUTO, or PARPORT_IRQ_PROBEONLY | 3126 | * autoirq is PARPORT_IRQ_NONE, PARPORT_IRQ_AUTO, or PARPORT_IRQ_PROBEONLY |
3127 | * autodma is PARPORT_DMA_NONE or PARPORT_DMA_AUTO | 3127 | * autodma is PARPORT_DMA_NONE or PARPORT_DMA_AUTO |
3128 | */ | 3128 | */ |
3129 | static int __init parport_pc_find_ports (int autoirq, int autodma) | 3129 | static void __init parport_pc_find_ports (int autoirq, int autodma) |
3130 | { | 3130 | { |
3131 | int count = 0, r; | 3131 | int count = 0, err; |
3132 | 3132 | ||
3133 | #ifdef CONFIG_PARPORT_PC_SUPERIO | 3133 | #ifdef CONFIG_PARPORT_PC_SUPERIO |
3134 | detect_and_report_winbond (); | 3134 | detect_and_report_winbond (); |
@@ -3140,23 +3140,17 @@ static int __init parport_pc_find_ports (int autoirq, int autodma) | |||
3140 | 3140 | ||
3141 | /* PnP ports, skip detection if SuperIO already found them */ | 3141 | /* PnP ports, skip detection if SuperIO already found them */ |
3142 | if (!count) { | 3142 | if (!count) { |
3143 | r = pnp_register_driver (&parport_pc_pnp_driver); | 3143 | err = pnp_register_driver (&parport_pc_pnp_driver); |
3144 | if (r >= 0) { | 3144 | if (!err) |
3145 | pnp_registered_parport = 1; | 3145 | pnp_registered_parport = 1; |
3146 | count += r; | ||
3147 | } | ||
3148 | } | 3146 | } |
3149 | 3147 | ||
3150 | /* ISA ports and whatever (see asm/parport.h). */ | 3148 | /* ISA ports and whatever (see asm/parport.h). */ |
3151 | count += parport_pc_find_nonpci_ports (autoirq, autodma); | 3149 | parport_pc_find_nonpci_ports (autoirq, autodma); |
3152 | |||
3153 | r = pci_register_driver (&parport_pc_pci_driver); | ||
3154 | if (r) | ||
3155 | return r; | ||
3156 | pci_registered_parport = 1; | ||
3157 | count += 1; | ||
3158 | 3150 | ||
3159 | return count; | 3151 | err = pci_register_driver (&parport_pc_pci_driver); |
3152 | if (!err) | ||
3153 | pci_registered_parport = 1; | ||
3160 | } | 3154 | } |
3161 | 3155 | ||
3162 | /* | 3156 | /* |
@@ -3381,8 +3375,6 @@ __setup("parport_init_mode=",parport_init_mode_setup); | |||
3381 | 3375 | ||
3382 | static int __init parport_pc_init(void) | 3376 | static int __init parport_pc_init(void) |
3383 | { | 3377 | { |
3384 | int count = 0; | ||
3385 | |||
3386 | if (parse_parport_params()) | 3378 | if (parse_parport_params()) |
3387 | return -EINVAL; | 3379 | return -EINVAL; |
3388 | 3380 | ||
@@ -3395,12 +3387,11 @@ static int __init parport_pc_init(void) | |||
3395 | break; | 3387 | break; |
3396 | if ((io_hi[i]) == PARPORT_IOHI_AUTO) | 3388 | if ((io_hi[i]) == PARPORT_IOHI_AUTO) |
3397 | io_hi[i] = 0x400 + io[i]; | 3389 | io_hi[i] = 0x400 + io[i]; |
3398 | if (parport_pc_probe_port(io[i], io_hi[i], | 3390 | parport_pc_probe_port(io[i], io_hi[i], |
3399 | irqval[i], dmaval[i], NULL)) | 3391 | irqval[i], dmaval[i], NULL); |
3400 | count++; | ||
3401 | } | 3392 | } |
3402 | } else | 3393 | } else |
3403 | count += parport_pc_find_ports (irqval[0], dmaval[0]); | 3394 | parport_pc_find_ports (irqval[0], dmaval[0]); |
3404 | 3395 | ||
3405 | return 0; | 3396 | return 0; |
3406 | } | 3397 | } |