Re: [PATCH v2 16/16] fpga: region: move device tree support to of-fpga-region.c

From: Wu Hao
Date: Fri Apr 28 2017 - 02:43:09 EST


On Thu, Apr 20, 2017 at 09:10:01AM -0500, Alan Tull wrote:
> Create of-fpga-region.c
>
> Move the following functions without modification from
> fpga-region.c to of-fpga-region.c:
>
> * of_fpga_region_find
> * of_fpga_region_get_mgr
> * of_fpga_region_get_bridges
> * child_regions_with_firmware
> * of_fpga_region_parse_ov
> * of_fpga_region_notify_pre_apply
> * of_fpga_region_notify_post_remove
> * of_fpga_region_notify
> * of_fpga_region_probe
> * of_fpga_region_remove
>
> Create two new function with some code from fpga_region_init/exit.
>
> * of_fpga_region_init
> * of_fpga_region_exit
>
> Signed-off-by: Alan Tull <atull@xxxxxxxxxx>
> ---
> v2: split out code changes into other patches, only move code here
> ---
> drivers/fpga/Kconfig | 13 +-
> drivers/fpga/Makefile | 1 +
> drivers/fpga/fpga-region.c | 449 +-------------------------------------
> drivers/fpga/of-fpga-region.c | 493 ++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 505 insertions(+), 451 deletions(-)
> create mode 100644 drivers/fpga/of-fpga-region.c
>
> diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig
> index 161ba9d..394c141 100644
> --- a/drivers/fpga/Kconfig
> +++ b/drivers/fpga/Kconfig
> @@ -15,10 +15,17 @@ if FPGA
>
> config FPGA_REGION
> tristate "FPGA Region"
> - depends on OF && FPGA_BRIDGE
> + depends on FPGA_BRIDGE
> + help
> + FPGA Region common code. A FPGA Region controls a FPGA Manager
> + and the FPGA Bridges associated with either a reconfigurable
> + region of an FPGA or a whole FPGA.
> +

Hi Alan

As FPGA_BRIDGE depends on OF, so FPGA_REGION still can't be selected
without OF. Should we remove the OF dependency for FPGA_BRIDGE as well?

Thanks
Hao