drivers/i2c/busses/i2c-mlxbf.c: In function ‘mlxbf_i2c_acpi_probe’:
drivers/i2c/busses/i2c-mlxbf.c:2296:8: error: implicit declaration of function ‘acpi_device_uid’; did you mean ‘cpu_device_up’? [-Werror=implicit-function-declaration]
uid = acpi_device_uid(adev);
^~~~~~~~~~~~~~~
cpu_device_up
Signed-off-by: Liu Shixin <[email protected]>
---
drivers/i2c/busses/i2c-mlxbf.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
index ee59e0da082d..cd8a909431a9 100644
--- a/drivers/i2c/busses/i2c-mlxbf.c
+++ b/drivers/i2c/busses/i2c-mlxbf.c
@@ -2272,6 +2272,7 @@ static const struct acpi_device_id mlxbf_i2c_acpi_ids[] = {
MODULE_DEVICE_TABLE(acpi, mlxbf_i2c_acpi_ids);
+#ifdef CONFIG_ACPI
static int mlxbf_i2c_acpi_probe(struct device *dev, struct mlxbf_i2c_priv *priv)
{
const struct acpi_device_id *aid;
@@ -2305,6 +2306,12 @@ static int mlxbf_i2c_acpi_probe(struct device *dev, struct mlxbf_i2c_priv *priv)
return ret;
}
+#else
+static int mlxbf_i2c_acpi_probe(struct device *dev, struct mlxbf_i2c_priv *priv)
+{
+ return -ENODEV;
+}
+#endif
static int mlxbf_i2c_of_probe(struct device *dev, struct mlxbf_i2c_priv *priv)
{
--
2.25.1
Hi Liu,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on wsa/i2c/for-next]
[also build test WARNING on v5.10-rc2 next-20201102]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Liu-Shixin/i2c-mlxbf-Fix-build-error-with-CONFIG_ACPI-disabled/20201102-194848
base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: arm64-randconfig-r002-20201102 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cc91554ebb66e8c9a4b8c67ca2f1343eaac10cf6)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/296e051e7e4a229ffefca237fd399a08c9ace3c4
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Liu-Shixin/i2c-mlxbf-Fix-build-error-with-CONFIG_ACPI-disabled/20201102-194848
git checkout 296e051e7e4a229ffefca237fd399a08c9ace3c4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
All warnings (new ones prefixed by >>):
>> drivers/i2c/busses/i2c-mlxbf.c:2267:36: warning: unused variable 'mlxbf_i2c_acpi_ids' [-Wunused-const-variable]
static const struct acpi_device_id mlxbf_i2c_acpi_ids[] = {
^
1 warning generated.
vim +/mlxbf_i2c_acpi_ids +2267 drivers/i2c/busses/i2c-mlxbf.c
b5b5b32081cd206 Khalil Blaiech 2020-09-22 2266
b5b5b32081cd206 Khalil Blaiech 2020-09-22 @2267 static const struct acpi_device_id mlxbf_i2c_acpi_ids[] = {
b5b5b32081cd206 Khalil Blaiech 2020-09-22 2268 { "MLNXBF03", (kernel_ulong_t)&mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_1] },
b5b5b32081cd206 Khalil Blaiech 2020-09-22 2269 { "MLNXBF23", (kernel_ulong_t)&mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_2] },
b5b5b32081cd206 Khalil Blaiech 2020-09-22 2270 {},
b5b5b32081cd206 Khalil Blaiech 2020-09-22 2271 };
b5b5b32081cd206 Khalil Blaiech 2020-09-22 2272
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
Liu, thank you very much for the fix.
Please note that I posted a patch series on October, 28th including
this fix. Also note that I posted a v2 today.
Khalil
> Subject: [PATCH] i2c: mlxbf: Fix build error with CONFIG_ACPI disabled
>
> drivers/i2c/busses/i2c-mlxbf.c: In function ‘mlxbf_i2c_acpi_probe’:
> drivers/i2c/busses/i2c-mlxbf.c:2296:8: error: implicit declaration of function
> ‘acpi_device_uid’; did you mean ‘cpu_device_up’? [-Werror=implicit-
> function-declaration]
> uid = acpi_device_uid(adev);
> ^~~~~~~~~~~~~~~
> cpu_device_up
>
> Signed-off-by: Liu Shixin <[email protected]>
> ---
> drivers/i2c/busses/i2c-mlxbf.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
> index ee59e0da082d..cd8a909431a9 100644
> --- a/drivers/i2c/busses/i2c-mlxbf.c
> +++ b/drivers/i2c/busses/i2c-mlxbf.c
> @@ -2272,6 +2272,7 @@ static const struct acpi_device_id
> mlxbf_i2c_acpi_ids[] = {
>
> MODULE_DEVICE_TABLE(acpi, mlxbf_i2c_acpi_ids);
>
> +#ifdef CONFIG_ACPI
> static int mlxbf_i2c_acpi_probe(struct device *dev, struct mlxbf_i2c_priv
> *priv)
> {
> const struct acpi_device_id *aid;
> @@ -2305,6 +2306,12 @@ static int mlxbf_i2c_acpi_probe(struct device
> *dev, struct mlxbf_i2c_priv *priv)
>
> return ret;
> }
> +#else
> +static int mlxbf_i2c_acpi_probe(struct device *dev, struct mlxbf_i2c_priv
> *priv)
> +{
> + return -ENODEV;
> +}
> +#endif
>
> static int mlxbf_i2c_of_probe(struct device *dev, struct mlxbf_i2c_priv
> *priv)
> {
> --
> 2.25.1