Commit 918e3592 authored by Kulikov Vasiliy's avatar Kulikov Vasiliy Committed by Greg Kroah-Hartman

staging: sm7xx: call disable_pci_device() if pci_probe() failed

Driver should call disable_pci_device() if it returns from pci_probe()
with error.
Signed-off-by: default avatarKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3a8f2d3c
...@@ -848,7 +848,6 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev, ...@@ -848,7 +848,6 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev,
"Silicon Motion display driver " SMTC_LINUX_FB_VERSION "\n"); "Silicon Motion display driver " SMTC_LINUX_FB_VERSION "\n");
err = pci_enable_device(pdev); /* enable SMTC chip */ err = pci_enable_device(pdev); /* enable SMTC chip */
if (err) if (err)
return err; return err;
err = -ENOMEM; err = -ENOMEM;
...@@ -859,7 +858,7 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev, ...@@ -859,7 +858,7 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev,
sfb = smtc_alloc_fb_info(pdev, name); sfb = smtc_alloc_fb_info(pdev, name);
if (!sfb) if (!sfb)
goto failed; goto failed_free;
/* Jason (08/13/2009) /* Jason (08/13/2009)
* Store fb_info to be further used when suspending and resuming * Store fb_info to be further used when suspending and resuming
*/ */
...@@ -917,7 +916,8 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev, ...@@ -917,7 +916,8 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev,
printk(KERN_INFO printk(KERN_INFO
"%s: unable to map memory mapped IO\n", "%s: unable to map memory mapped IO\n",
sfb->fb.fix.id); sfb->fb.fix.id);
return -ENOMEM; err = -ENOMEM;
goto failed_fb;
} }
/* set MCLK = 14.31818 * (0x16 / 0x2) */ /* set MCLK = 14.31818 * (0x16 / 0x2) */
...@@ -951,8 +951,7 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev, ...@@ -951,8 +951,7 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev,
printk(KERN_INFO printk(KERN_INFO
"No valid Silicon Motion display chip was detected!\n"); "No valid Silicon Motion display chip was detected!\n");
smtc_free_fb_info(sfb); goto failed_fb;
return err;
} }
/* can support 32 bpp */ /* can support 32 bpp */
...@@ -986,8 +985,12 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev, ...@@ -986,8 +985,12 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev,
smtc_unmap_smem(sfb); smtc_unmap_smem(sfb);
smtc_unmap_mmio(sfb); smtc_unmap_mmio(sfb);
failed_fb:
smtc_free_fb_info(sfb); smtc_free_fb_info(sfb);
failed_free:
pci_disable_device(pdev);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment