From c196de13770f0561ccc1dabb48da642d098d52ec Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Mon, 4 Dec 2023 09:59:03 +0000 Subject: [PATCH] spi: tegra124-slave: Fix callback prototype The Tegra124 SPI slave driver declares a prototype for the function tegra_spi_slave_register_callback() that does not exist. The correct function name is tegra124_spi_slave_register_callback() and so fix the prototype accordingly. Move the prototype to an actual header because this is the correct place for defining prototypes for other drivers to reference. This was caught by enabling the compiler flag -Wmissing-prototype. Bug 4404965 Change-Id: I765723d0a5ed6369784e5f6c480a6f03500659f3 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3027487 (cherry picked from commit 19a85c968c246f3c1cfd06c2dea56deacc170ae0) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3031243 Reviewed-by: Brad Griffis GVS: Gerrit_Virtual_Submit --- drivers/spi/spi-tegra124-slave.c | 11 +++-------- include/linux/spi/spi-tegra124-slave.h | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 include/linux/spi/spi-tegra124-slave.h diff --git a/drivers/spi/spi-tegra124-slave.c b/drivers/spi/spi-tegra124-slave.c index 246e0b45..10ffee53 100644 --- a/drivers/spi/spi-tegra124-slave.c +++ b/drivers/spi/spi-tegra124-slave.c @@ -1,5 +1,5 @@ -// SPDX-License-Identifier: GPL-2.0 -// Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (C) 2023 NVIDIA CORPORATION. All rights reserved. #include #include @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -277,12 +278,6 @@ struct tegra_spi_controller_data { int cs_gpio; }; -typedef int (*spi_callback)(void *client_data); -int tegra_spi_slave_register_callback(struct spi_device *spi, - spi_callback func_ready, - spi_callback func_isr, - void *client_data); - struct tegra_spi_data { struct device *dev; struct spi_controller *controller; diff --git a/include/linux/spi/spi-tegra124-slave.h b/include/linux/spi/spi-tegra124-slave.h new file mode 100644 index 00000000..4c1c6440 --- /dev/null +++ b/include/linux/spi/spi-tegra124-slave.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * SPDX-FileCopyrightText: Copyright (C) 2023 NVIDIA CORPORATION. All rights reserved. + */ + +#ifndef __LINUX_SPI_TEGRA124_SLAVE_H +#define __LINUX_SPI_TEGRA124_SLAVE_H + +#include + +typedef int (*spi_callback)(void *client_data); + +int tegra124_spi_slave_register_callback(struct spi_device *spi, + spi_callback func_ready, + spi_callback func_isr, + void *client_data); +#endif