diff options
author | Ville Syrjala <syrjala@sci.fi> | 2006-12-08 05:40:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 11:29:07 -0500 |
commit | 4ec3fd71e4f5d1201cb7d2374ffdb4f328091fb4 (patch) | |
tree | f8d4ceae49f18302ba25382d9300549a7b349ec2 /drivers | |
parent | cab5901e93bfe4f3cfd8cf9cda2558d22568f7a2 (diff) |
[PATCH] atyfb: Improve atyfb_atari_probe()
Improve atyfb_atari_probe():
* Call correct_chipset() so that more par members, par->features in
particular, get initialized.
* If probe fails iounmap() the mapped regions and continue probing for more
adapters.
Only verified to cross-compile due to lack of hardware.
Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/aty/atyfb_base.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index d4262b8b8e02..a9c73c257f3a 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c | |||
@@ -3629,6 +3629,7 @@ static int __init atyfb_atari_probe(void) | |||
3629 | struct fb_info *info; | 3629 | struct fb_info *info; |
3630 | int m64_num; | 3630 | int m64_num; |
3631 | u32 clock_r; | 3631 | u32 clock_r; |
3632 | int num_found = 0; | ||
3632 | 3633 | ||
3633 | for (m64_num = 0; m64_num < mach64_count; m64_num++) { | 3634 | for (m64_num = 0; m64_num < mach64_count; m64_num++) { |
3634 | if (!phys_vmembase[m64_num] || !phys_size[m64_num] || | 3635 | if (!phys_vmembase[m64_num] || !phys_size[m64_num] || |
@@ -3676,16 +3677,28 @@ static int __init atyfb_atari_probe(void) | |||
3676 | break; | 3677 | break; |
3677 | } | 3678 | } |
3678 | 3679 | ||
3679 | if (aty_init(info)) { | 3680 | /* Fake pci_id for correct_chipset() */ |
3680 | if (info->screen_base) | 3681 | switch (aty_ld_le32(CONFIG_CHIP_ID, par) & CFG_CHIP_TYPE) { |
3681 | iounmap(info->screen_base); | 3682 | case 0x00d7: |
3682 | if (par->ati_regbase) | 3683 | par->pci_id = PCI_CHIP_MACH64GX; |
3683 | iounmap(par->ati_regbase); | 3684 | break; |
3685 | case 0x0057: | ||
3686 | par->pci_id = PCI_CHIP_MACH64CX; | ||
3687 | break; | ||
3688 | default: | ||
3689 | break; | ||
3690 | } | ||
3691 | |||
3692 | if (correct_chipset(par) || aty_init(info)) { | ||
3693 | iounmap(info->screen_base); | ||
3694 | iounmap(par->ati_regbase); | ||
3684 | framebuffer_release(info); | 3695 | framebuffer_release(info); |
3685 | /* This is insufficient! kernel_map has added two large chunks!! */ | 3696 | } else { |
3686 | return -ENXIO; | 3697 | num_found++; |
3687 | } | 3698 | } |
3688 | } | 3699 | } |
3700 | |||
3701 | return num_found ? 0 : -ENXIO; | ||
3689 | } | 3702 | } |
3690 | 3703 | ||
3691 | #endif /* CONFIG_ATARI */ | 3704 | #endif /* CONFIG_ATARI */ |