From 150c5afe5bafa90e4fe398e59af32ad3cdbfe5b7 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 30 May 2017 21:47:09 -0600 Subject: dm: gpio: Add live tree support Add support for requesting GPIOs with a live device tree. This involves adjusting the function signature for the legacy function gpio_request_by_name_nodev(), so fix up all callers. Signed-off-by: Simon Glass Fixes to stm32f746-disco.c: Signed-off-by: Tom Rini --- board/samsung/common/board.c | 4 ++-- board/samsung/common/exynos5-dt.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'board/samsung') diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c index 17626966aa..88299f17e3 100644 --- a/board/samsung/common/board.c +++ b/board/samsung/common/board.c @@ -351,8 +351,8 @@ void reset_misc(void) if (node < 0) return; - gpio_request_by_name_nodev(gd->fdt_blob, node, "reset-gpio", 0, &gpio, - GPIOD_IS_OUT); + gpio_request_by_name_nodev(offset_to_ofnode(node), "reset-gpio", 0, + &gpio, GPIOD_IS_OUT); if (dm_gpio_is_valid(&gpio)) { /* diff --git a/board/samsung/common/exynos5-dt.c b/board/samsung/common/exynos5-dt.c index aec1f396b0..44f412db5d 100644 --- a/board/samsung/common/exynos5-dt.c +++ b/board/samsung/common/exynos5-dt.c @@ -45,7 +45,7 @@ static void board_enable_audio_codec(void) if (node <= 0) return; - ret = gpio_request_by_name_nodev(gd->fdt_blob, node, + ret = gpio_request_by_name_nodev(offset_to_ofnode(node), "codec-enable-gpio", 0, &en_gpio, GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE); if (ret == -FDT_ERR_NOTFOUND) -- cgit