diff options
Diffstat (limited to 'drivers/video/backlight/progear_bl.c')
-rw-r--r-- | drivers/video/backlight/progear_bl.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/video/backlight/progear_bl.c b/drivers/video/backlight/progear_bl.c index 075786e05034..2ec16deb2397 100644 --- a/drivers/video/backlight/progear_bl.c +++ b/drivers/video/backlight/progear_bl.c | |||
@@ -63,6 +63,7 @@ static int progearbl_probe(struct platform_device *pdev) | |||
63 | { | 63 | { |
64 | u8 temp; | 64 | u8 temp; |
65 | struct backlight_device *progear_backlight_device; | 65 | struct backlight_device *progear_backlight_device; |
66 | int ret; | ||
66 | 67 | ||
67 | pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, NULL); | 68 | pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, NULL); |
68 | if (!pmu_dev) { | 69 | if (!pmu_dev) { |
@@ -73,8 +74,8 @@ static int progearbl_probe(struct platform_device *pdev) | |||
73 | sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); | 74 | sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); |
74 | if (!sb_dev) { | 75 | if (!sb_dev) { |
75 | printk("ALI 1533 SB not found.\n"); | 76 | printk("ALI 1533 SB not found.\n"); |
76 | pci_dev_put(pmu_dev); | 77 | ret = -ENODEV; |
77 | return -ENODEV; | 78 | goto put_pmu; |
78 | } | 79 | } |
79 | 80 | ||
80 | /* Set SB_MPS1 to enable brightness control. */ | 81 | /* Set SB_MPS1 to enable brightness control. */ |
@@ -84,8 +85,10 @@ static int progearbl_probe(struct platform_device *pdev) | |||
84 | progear_backlight_device = backlight_device_register("progear-bl", | 85 | progear_backlight_device = backlight_device_register("progear-bl", |
85 | &pdev->dev, NULL, | 86 | &pdev->dev, NULL, |
86 | &progearbl_ops); | 87 | &progearbl_ops); |
87 | if (IS_ERR(progear_backlight_device)) | 88 | if (IS_ERR(progear_backlight_device)) { |
88 | return PTR_ERR(progear_backlight_device); | 89 | ret = PTR_ERR(progear_backlight_device); |
90 | goto put_sb; | ||
91 | } | ||
89 | 92 | ||
90 | platform_set_drvdata(pdev, progear_backlight_device); | 93 | platform_set_drvdata(pdev, progear_backlight_device); |
91 | 94 | ||
@@ -95,6 +98,11 @@ static int progearbl_probe(struct platform_device *pdev) | |||
95 | progearbl_set_intensity(progear_backlight_device); | 98 | progearbl_set_intensity(progear_backlight_device); |
96 | 99 | ||
97 | return 0; | 100 | return 0; |
101 | put_sb: | ||
102 | pci_dev_put(sb_dev); | ||
103 | put_pmu: | ||
104 | pci_dev_put(pmu_dev); | ||
105 | return ret; | ||
98 | } | 106 | } |
99 | 107 | ||
100 | static int progearbl_remove(struct platform_device *pdev) | 108 | static int progearbl_remove(struct platform_device *pdev) |