Skip to content

Commit

Permalink
tridentfb: improve probe function
Browse files Browse the repository at this point in the history
Add missing release of allocated fb_info structure and move enable_mmio() to
fix error path.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Krzysztof Helt authored and Linus Torvalds committed Jul 24, 2008
1 parent 6bdf103 commit 3876ae8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/video/tridentfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,7 @@ static int __devinit trident_pci_probe(struct pci_dev *dev,

if (!request_mem_region(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len, "tridentfb")) {
debug("request_region failed!\n");
framebuffer_release(info);
return -1;
}

Expand All @@ -1299,8 +1300,6 @@ static int __devinit trident_pci_probe(struct pci_dev *dev,
goto out_unmap1;
}

enable_mmio();

/* setup framebuffer memory */
tridentfb_fix.smem_start = pci_resource_start(dev, 0);
tridentfb_fix.smem_len = get_memsize(default_par);
Expand All @@ -1312,6 +1311,8 @@ static int __devinit trident_pci_probe(struct pci_dev *dev,
goto out_unmap1;
}

enable_mmio();

info->screen_base = ioremap_nocache(tridentfb_fix.smem_start,
tridentfb_fix.smem_len);

Expand Down

0 comments on commit 3876ae8

Please sign in to comment.