Skip to content

Commit ed01ddc

Browse files
kblaiechwsakernel
authored andcommitted
i2c: mlxbf: Add CONFIG_ACPI to guard ACPI function call
The build fails with "implicit declaration of function 'acpi_device_uid'" error. Thus, protect ACPI function calls from being called when CONFIG_ACPI is disabled. Fixes: b5b5b32 ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC") Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Vadim Pasternak <vadimp@nvidia.com> Signed-off-by: Khalil Blaiech <kblaiech@nvidia.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent a49cc1f commit ed01ddc

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

drivers/i2c/busses/i2c-mlxbf.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,6 +2264,7 @@ static const struct of_device_id mlxbf_i2c_dt_ids[] = {
22642264

22652265
MODULE_DEVICE_TABLE(of, mlxbf_i2c_dt_ids);
22662266

2267+
#ifdef CONFIG_ACPI
22672268
static const struct acpi_device_id mlxbf_i2c_acpi_ids[] = {
22682269
{ "MLNXBF03", (kernel_ulong_t)&mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_1] },
22692270
{ "MLNXBF23", (kernel_ulong_t)&mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_2] },
@@ -2305,6 +2306,12 @@ static int mlxbf_i2c_acpi_probe(struct device *dev, struct mlxbf_i2c_priv *priv)
23052306

23062307
return ret;
23072308
}
2309+
#else
2310+
static int mlxbf_i2c_acpi_probe(struct device *dev, struct mlxbf_i2c_priv *priv)
2311+
{
2312+
return -ENOENT;
2313+
}
2314+
#endif /* CONFIG_ACPI */
23082315

23092316
static int mlxbf_i2c_of_probe(struct device *dev, struct mlxbf_i2c_priv *priv)
23102317
{
@@ -2473,7 +2480,9 @@ static struct platform_driver mlxbf_i2c_driver = {
24732480
.driver = {
24742481
.name = "i2c-mlxbf",
24752482
.of_match_table = mlxbf_i2c_dt_ids,
2483+
#ifdef CONFIG_ACPI
24762484
.acpi_match_table = ACPI_PTR(mlxbf_i2c_acpi_ids),
2485+
#endif /* CONFIG_ACPI */
24772486
},
24782487
};
24792488

0 commit comments

Comments
 (0)