Commit 5634cbab authored by Russell King's avatar Russell King Committed by Bartlomiej Zolnierkiewicz

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: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent f6fc8c9d
...@@ -1246,18 +1246,18 @@ static int sa1100fb_probe(struct platform_device *pdev) ...@@ -1246,18 +1246,18 @@ static int sa1100fb_probe(struct platform_device *pdev)
goto failed; goto failed;
} }
/* Initialize video memory */
ret = sa1100fb_map_video_memory(fbi);
if (ret)
goto failed;
if (machine_is_shannon()) { if (machine_is_shannon()) {
ret = gpio_request_one(SHANNON_GPIO_DISP_EN, ret = devm_gpio_request_one(&pdev->dev, SHANNON_GPIO_DISP_EN,
GPIOF_OUT_INIT_LOW, "display enable"); GPIOF_OUT_INIT_LOW, "display enable");
if (ret) if (ret)
goto failed; goto failed;
} }
/* Initialize video memory */
ret = sa1100fb_map_video_memory(fbi);
if (ret)
goto failed;
/* /*
* This makes sure that our colour bitfield * This makes sure that our colour bitfield
* descriptors are correctly initialised. * descriptors are correctly initialised.
...@@ -1268,7 +1268,7 @@ static int sa1100fb_probe(struct platform_device *pdev) ...@@ -1268,7 +1268,7 @@ static int sa1100fb_probe(struct platform_device *pdev)
ret = register_framebuffer(&fbi->fb); ret = register_framebuffer(&fbi->fb);
if (ret < 0) if (ret < 0)
goto err_reg_fb; goto failed;
#ifdef CONFIG_CPU_FREQ #ifdef CONFIG_CPU_FREQ
fbi->freq_transition.notifier_call = sa1100fb_freq_transition; fbi->freq_transition.notifier_call = sa1100fb_freq_transition;
...@@ -1280,9 +1280,6 @@ static int sa1100fb_probe(struct platform_device *pdev) ...@@ -1280,9 +1280,6 @@ static int sa1100fb_probe(struct platform_device *pdev)
/* This driver cannot be unloaded at the moment */ /* This driver cannot be unloaded at the moment */
return 0; return 0;
err_reg_fb:
if (machine_is_shannon())
gpio_free(SHANNON_GPIO_DISP_EN);
failed: failed:
return ret; return ret;
} }
......
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