diff --git a/drivers/net/can/mttcan/hal/m_ttcan.c b/drivers/net/can/mttcan/hal/m_ttcan.c index 1d3037a2..9114c27f 100644 --- a/drivers/net/can/mttcan/hal/m_ttcan.c +++ b/drivers/net/can/mttcan/hal/m_ttcan.c @@ -291,7 +291,7 @@ inline u32 ttcan_read_ecr(struct ttcan_controller *ttcan) return ttcan_read32(ttcan, ADR_MTTCAN_ECR); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +#if !defined(CONFIG_TEGRA_PROD_NEXT_GEN) static void tegra_mttcan_config_prod_settings(struct mttcan_priv *priv) { struct ttcan_controller *ttcan = priv->ttcan; diff --git a/drivers/net/can/mttcan/include/m_ttcan.h b/drivers/net/can/mttcan/include/m_ttcan.h index 9155f8ee..6f55f49f 100644 --- a/drivers/net/can/mttcan/include/m_ttcan.h +++ b/drivers/net/can/mttcan/include/m_ttcan.h @@ -287,7 +287,7 @@ struct ttcan_controller { struct list_head rx_q1; struct list_head rx_b; struct list_head tx_evt; -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +#if !defined(CONFIG_TEGRA_PROD_NEXT_GEN) struct tegra_prod *prod_list; #else struct tegra_prod_cfg_list *prod_list; diff --git a/drivers/net/can/mttcan/native/m_ttcan_linux.c b/drivers/net/can/mttcan/native/m_ttcan_linux.c index 5eb5cda0..b54aa907 100644 --- a/drivers/net/can/mttcan/native/m_ttcan_linux.c +++ b/drivers/net/can/mttcan/native/m_ttcan_linux.c @@ -12,7 +12,7 @@ #define CAN_MSG_FLUSH_TIMEOUT 100 static void mttcan_start(struct net_device *dev); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) +#if defined(CONFIG_TEGRA_PROD_NEXT_GEN) #define MTTCAN_PROD_FIELD(name, rindex, roffset, fname) \ { \ .field_name = name, \ @@ -1877,7 +1877,7 @@ static int mttcan_probe(struct platform_device *pdev) if (ret) goto exit_free_device; -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +#if !defined(CONFIG_TEGRA_PROD_NEXT_GEN) priv->ttcan->prod_list = devm_tegra_prod_get(&pdev->dev); #else priv->ttcan->prod_list = devm_tegra_prod_get_list(&pdev->dev, &mttcan_prod_dev_info); diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c index c7a7a631..93012135 100644 --- a/drivers/spi/spi-tegra210-quad.c +++ b/drivers/spi/spi-tegra210-quad.c @@ -254,14 +254,14 @@ struct tegra_qspi { dma_addr_t tx_dma_phys; struct dma_async_tx_descriptor *tx_dma_desc; const struct tegra_qspi_soc_data *soc_data; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) +#if defined(CONFIG_TEGRA_PROD_NEXT_GEN) struct tegra_prod_cfg_list *prod_list; #else struct tegra_prod *prod_list; #endif }; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) +#if defined(CONFIG_TEGRA_PROD_NEXT_GEN) #define QSPI_PROD_FIELD(name, rindex, roffset, fname) \ { \ .field_name = name, \ @@ -962,7 +962,7 @@ static u32 tegra_qspi_setup_transfer_one(struct spi_device *spi, struct spi_tran return command1; } -#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 16, 0) +#if defined(CONFIG_TEGRA_PROD_NEXT_GEN) static void tegra_qspi_write_prod_settings(struct tegra_qspi *tqspi, const char *prod_name) { struct tegra_prod_reg_info *reg_info; @@ -986,7 +986,7 @@ static void tegra_qspi_write_prod_settings(struct tegra_qspi *tqspi, const char static void tegra_qspi_set_gr_registers(struct tegra_qspi *tqspi) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +#if !defined(CONFIG_TEGRA_PROD_NEXT_GEN) int err; #endif @@ -996,7 +996,7 @@ static void tegra_qspi_set_gr_registers(struct tegra_qspi *tqspi) /* If available, initialise the config registers * for QSPI with the values mentioned in prod list. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +#if !defined(CONFIG_TEGRA_PROD_NEXT_GEN) err = tegra_prod_set_by_name(&tqspi->base, "prod", tqspi->prod_list); if (err < 0) dev_info_once(tqspi->dev, @@ -1726,7 +1726,7 @@ static int tegra_qspi_probe(struct platform_device *pdev) tqspi->master = master; tqspi->dev = &pdev->dev; -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +#if !defined(CONFIG_TEGRA_PROD_NEXT_GEN) tqspi->prod_list = devm_tegra_prod_get(&pdev->dev); #else tqspi->prod_list = devm_tegra_prod_get_list(&pdev->dev, &qspi_prod_dev_info); diff --git a/include/linux/tegra-oot-prod.h b/include/linux/tegra-oot-prod.h index 19b7ec17..74c59553 100644 --- a/include/linux/tegra-oot-prod.h +++ b/include/linux/tegra-oot-prod.h @@ -8,19 +8,13 @@ #include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) -#ifdef CONFIG_TEGRA_PROD_LEGACY +#if defined(CONFIG_TEGRA_PROD_NEXT_GEN) #include -#include -#else -#include #include -#endif -#else /* LINUX_VERSION_CODE */ -#ifdef CONFIG_TEGRA_PROD_LEGACY +#elif defined(CONFIG_TEGRA_PROD_LEGACY) #include #else #include #endif -#endif /* LINUX_VERSION_CODE */ + #endif /* _TEGRA_OOT_PRODS_H */