mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
spi: Fix build for Linux v6.13
Commit 0809a9ccac4a ("spi: remove {devm_}spi_alloc_master/slave()")
removed devm_spi_alloc_master() and this breaks building the Tegra124
and Tegra210 SPI drivers for Linux v6.13. Commit b8d3b056a78d ("spi:
introduce new helpers with using modern naming") previously added new
helpers in Linux v6.2 which should be instead. Add a test for conftest
to detect if the kernel supports the function devm_spi_alloc_host()
and if so use this function.
Bug 4991705
Change-Id: I1d639297ef7adfdcde50927360607639b45a4a60
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261698
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
This commit is contained in:
@@ -2017,7 +2017,11 @@ static int tegra_spi_probe(struct platform_device *pdev)
|
|||||||
pdata->rx_trig_words != 4 && pdata->rx_trig_words != 8)
|
pdata->rx_trig_words != 4 && pdata->rx_trig_words != 8)
|
||||||
pdata->rx_trig_words = 0;
|
pdata->rx_trig_words = 0;
|
||||||
|
|
||||||
|
#if defined(NV_DEVM_SPI_ALLOC_HOST_PRESENT) /* Linux v6.2 */
|
||||||
|
controller = devm_spi_alloc_host(&pdev->dev, sizeof(*tspi));
|
||||||
|
#else
|
||||||
controller = devm_spi_alloc_master(&pdev->dev, sizeof(*tspi));
|
controller = devm_spi_alloc_master(&pdev->dev, sizeof(*tspi));
|
||||||
|
#endif
|
||||||
if (!controller) {
|
if (!controller) {
|
||||||
dev_err(&pdev->dev, "controller allocation failed\n");
|
dev_err(&pdev->dev, "controller allocation failed\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|||||||
@@ -1660,7 +1660,11 @@ static int tegra_qspi_probe(struct platform_device *pdev)
|
|||||||
int bus_num;
|
int bus_num;
|
||||||
u32 as_delay;
|
u32 as_delay;
|
||||||
|
|
||||||
|
#if defined(NV_DEVM_SPI_ALLOC_HOST_PRESENT) /* Linux v6.2 */
|
||||||
|
controller = devm_spi_alloc_host(&pdev->dev, sizeof(*tqspi));
|
||||||
|
#else
|
||||||
controller = devm_spi_alloc_master(&pdev->dev, sizeof(*tqspi));
|
controller = devm_spi_alloc_master(&pdev->dev, sizeof(*tqspi));
|
||||||
|
#endif
|
||||||
if (!controller)
|
if (!controller)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += devfreq_dev_profile_has_is_cooling_device
|
|||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += devfreq_has_freq_table
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += devfreq_has_freq_table
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += device_add_disk_has_int_return_type
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += device_add_disk_has_int_return_type
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_pm_domain_attach_list
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_pm_domain_attach_list
|
||||||
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_spi_alloc_host
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_tegra_core_dev_init_opp_table_common
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_tegra_core_dev_init_opp_table_common
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_thermal_of_zone_register
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_thermal_of_zone_register
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += disk_check_media_change
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += disk_check_media_change
|
||||||
|
|||||||
@@ -6919,6 +6919,23 @@ compile_test() {
|
|||||||
compile_check_conftest "$CODE" "NV_DEVM_PM_DOMAIN_ATTACH_LIST_PRESENT" "" "functions"
|
compile_check_conftest "$CODE" "NV_DEVM_PM_DOMAIN_ATTACH_LIST_PRESENT" "" "functions"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
devm_spi_alloc_host)
|
||||||
|
#
|
||||||
|
# Determine whether devm_spi_alloc_host() is present.
|
||||||
|
#
|
||||||
|
# Commit b8d3b056a78d ("spi: introduce new helpers with using modern
|
||||||
|
# naming") added devm_spi_alloc_host() in Linux v6.2.
|
||||||
|
#
|
||||||
|
CODE="
|
||||||
|
#undef CONFIG_ACPI
|
||||||
|
#include <linux/spi/spi.h>
|
||||||
|
void conftest_devm_spi_alloc_host(void) {
|
||||||
|
devm_spi_alloc_host();
|
||||||
|
}"
|
||||||
|
|
||||||
|
compile_check_conftest "$CODE" "NV_DEVM_SPI_ALLOC_HOST_PRESENT" "" "functions"
|
||||||
|
;;
|
||||||
|
|
||||||
devm_tegra_core_dev_init_opp_table_common)
|
devm_tegra_core_dev_init_opp_table_common)
|
||||||
#
|
#
|
||||||
# Determine whether devm_tegra_core_dev_init_opp_table_common is
|
# Determine whether devm_tegra_core_dev_init_opp_table_common is
|
||||||
|
|||||||
Reference in New Issue
Block a user