diff options
| author | Russell King <rmk+kernel@armlinux.org.uk> | 2017-10-17 10:01:12 -0400 |
|---|---|---|
| committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2017-10-17 10:01:12 -0400 |
| commit | 5634cbab489e8428f352f257b631c128b8dc869d (patch) | |
| tree | 740e7e70f0d7b03c81933ae908e830205dbbbb8c | |
| parent | f6fc8c9dbdc976e4933c5edc13764eafe9897313 (diff) | |
video: sa1100fb: use devm_gpio_request_one()
Switch to using devm_gpio_request_one() to request the shannon gpio
and move the request before the video memory allocation, so we request
all device managed resources before this large allocation attempt.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
| -rw-r--r-- | drivers/video/fbdev/sa1100fb.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c index a48fdb676f3e..7fa6c8f74ec6 100644 --- a/drivers/video/fbdev/sa1100fb.c +++ b/drivers/video/fbdev/sa1100fb.c | |||
| @@ -1246,18 +1246,18 @@ static int sa1100fb_probe(struct platform_device *pdev) | |||
| 1246 | goto failed; | 1246 | goto failed; |
| 1247 | } | 1247 | } |
| 1248 | 1248 | ||
| 1249 | /* Initialize video memory */ | ||
| 1250 | ret = sa1100fb_map_video_memory(fbi); | ||
| 1251 | if (ret) | ||
| 1252 | goto failed; | ||
| 1253 | |||
| 1254 | if (machine_is_shannon()) { | 1249 | if (machine_is_shannon()) { |
| 1255 | ret = gpio_request_one(SHANNON_GPIO_DISP_EN, | 1250 | ret = devm_gpio_request_one(&pdev->dev, SHANNON_GPIO_DISP_EN, |
| 1256 | GPIOF_OUT_INIT_LOW, "display enable"); | 1251 | GPIOF_OUT_INIT_LOW, "display enable"); |
| 1257 | if (ret) | 1252 | if (ret) |
| 1258 | goto failed; | 1253 | goto failed; |
| 1259 | } | 1254 | } |
| 1260 | 1255 | ||
| 1256 | /* Initialize video memory */ | ||
| 1257 | ret = sa1100fb_map_video_memory(fbi); | ||
| 1258 | if (ret) | ||
| 1259 | goto failed; | ||
| 1260 | |||
| 1261 | /* | 1261 | /* |
| 1262 | * This makes sure that our colour bitfield | 1262 | * This makes sure that our colour bitfield |
| 1263 | * descriptors are correctly initialised. | 1263 | * descriptors are correctly initialised. |
| @@ -1268,7 +1268,7 @@ static int sa1100fb_probe(struct platform_device *pdev) | |||
| 1268 | 1268 | ||
| 1269 | ret = register_framebuffer(&fbi->fb); | 1269 | ret = register_framebuffer(&fbi->fb); |
| 1270 | if (ret < 0) | 1270 | if (ret < 0) |
| 1271 | goto err_reg_fb; | 1271 | goto failed; |
| 1272 | 1272 | ||
| 1273 | #ifdef CONFIG_CPU_FREQ | 1273 | #ifdef CONFIG_CPU_FREQ |
| 1274 | fbi->freq_transition.notifier_call = sa1100fb_freq_transition; | 1274 | fbi->freq_transition.notifier_call = sa1100fb_freq_transition; |
| @@ -1280,9 +1280,6 @@ static int sa1100fb_probe(struct platform_device *pdev) | |||
| 1280 | /* This driver cannot be unloaded at the moment */ | 1280 | /* This driver cannot be unloaded at the moment */ |
| 1281 | return 0; | 1281 | return 0; |
| 1282 | 1282 | ||
| 1283 | err_reg_fb: | ||
| 1284 | if (machine_is_shannon()) | ||
| 1285 | gpio_free(SHANNON_GPIO_DISP_EN); | ||
| 1286 | failed: | 1283 | failed: |
| 1287 | return ret; | 1284 | return ret; |
| 1288 | } | 1285 | } |
