[PATCH 10/19] fpga: Migrate CONFIG_MAX_FPGA_DEVICES to Kconfig

Michal Simek michal.simek at amd.com
Wed Jan 11 09:17:25 CET 2023



On 1/10/23 17:19, Tom Rini wrote:
> This is always defined to 5, so use that as the default.
> 
> Cc: Michal Simek <michal.simek at amd.com>
> Signed-off-by: Tom Rini <trini at konsulko.com>
> ---
>   drivers/fpga/Kconfig | 5 +++++
>   drivers/fpga/fpga.c  | 5 -----
>   include/fpga.h       | 4 ----
>   3 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig
> index 11b742eeebfe..4113de230cd9 100644
> --- a/drivers/fpga/Kconfig
> +++ b/drivers/fpga/Kconfig
> @@ -153,4 +153,9 @@ config SANDBOX_FPGA
>   	  This is a driver model based FPGA driver for sandbox.
>   	  Currently it is a stub only, as there are no usable uclass methods yet.
>   
> +config MAX_FPGA_DEVICES
> +	int "Maximum number of FPGA devices"
> +	depends on FPGA
> +	default 5
> +
>   endmenu
> diff --git a/drivers/fpga/fpga.c b/drivers/fpga/fpga.c
> index 4db5c0a91e98..7f6b6bc73a1f 100644
> --- a/drivers/fpga/fpga.c
> +++ b/drivers/fpga/fpga.c
> @@ -13,11 +13,6 @@
>   #include <lattice.h>
>   #include <dm/device_compat.h>
>   
> -/* Local definitions */
> -#ifndef CONFIG_MAX_FPGA_DEVICES
> -#define CONFIG_MAX_FPGA_DEVICES		5
> -#endif
> -
>   /* Local static data */
>   static int next_desc = FPGA_INVALID_DEVICE;
>   static fpga_desc desc_table[CONFIG_MAX_FPGA_DEVICES];
> diff --git a/include/fpga.h b/include/fpga.h
> index a4e16401da72..ed688cc0fa3b 100644
> --- a/include/fpga.h
> +++ b/include/fpga.h
> @@ -9,10 +9,6 @@
>   #ifndef _FPGA_H_
>   #define _FPGA_H_
>   
> -#ifndef CONFIG_MAX_FPGA_DEVICES
> -#define CONFIG_MAX_FPGA_DEVICES		5
> -#endif
> -
>   /* fpga_xxxx function return value definitions */
>   #define FPGA_SUCCESS		0
>   #define FPGA_FAIL		1

Reviewed-by: Michal Simek <michal.simek at amd.com>

Thanks,
Michal


More information about the U-Boot mailing list