i2c: mlxbf: depend on ACPI; clean away ifdeffage

This fixes maybe_unused warnings/errors.

According to a comment during device tree removal, only ACPI is supported,
thus let's actually require it.

Fixes: be18c5ede2 ("i2c: mlxbf: remove device tree support")
Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
This commit is contained in:
Adam Borowski 2022-10-10 20:33:51 +02:00 committed by Wolfram Sang
parent fdf23c62d9
commit 65d78b8d04
2 changed files with 1 additions and 9 deletions

View File

@ -764,6 +764,7 @@ config I2C_LPC2K
config I2C_MLXBF config I2C_MLXBF
tristate "Mellanox BlueField I2C controller" tristate "Mellanox BlueField I2C controller"
depends on MELLANOX_PLATFORM && ARM64 depends on MELLANOX_PLATFORM && ARM64
depends on ACPI
select I2C_SLAVE select I2C_SLAVE
help help
Enabling this option will add I2C SMBus support for Mellanox BlueField Enabling this option will add I2C SMBus support for Mellanox BlueField

View File

@ -2247,7 +2247,6 @@ static struct i2c_adapter_quirks mlxbf_i2c_quirks = {
.max_write_len = MLXBF_I2C_MASTER_DATA_W_LENGTH, .max_write_len = MLXBF_I2C_MASTER_DATA_W_LENGTH,
}; };
#ifdef CONFIG_ACPI
static const struct acpi_device_id mlxbf_i2c_acpi_ids[] = { static const struct acpi_device_id mlxbf_i2c_acpi_ids[] = {
{ "MLNXBF03", (kernel_ulong_t)&mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_1] }, { "MLNXBF03", (kernel_ulong_t)&mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_1] },
{ "MLNXBF23", (kernel_ulong_t)&mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_2] }, { "MLNXBF23", (kernel_ulong_t)&mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_2] },
@ -2282,12 +2281,6 @@ static int mlxbf_i2c_acpi_probe(struct device *dev, struct mlxbf_i2c_priv *priv)
return 0; return 0;
} }
#else
static int mlxbf_i2c_acpi_probe(struct device *dev, struct mlxbf_i2c_priv *priv)
{
return -ENOENT;
}
#endif /* CONFIG_ACPI */
static int mlxbf_i2c_probe(struct platform_device *pdev) static int mlxbf_i2c_probe(struct platform_device *pdev)
{ {
@ -2490,9 +2483,7 @@ static struct platform_driver mlxbf_i2c_driver = {
.remove = mlxbf_i2c_remove, .remove = mlxbf_i2c_remove,
.driver = { .driver = {
.name = "i2c-mlxbf", .name = "i2c-mlxbf",
#ifdef CONFIG_ACPI
.acpi_match_table = ACPI_PTR(mlxbf_i2c_acpi_ids), .acpi_match_table = ACPI_PTR(mlxbf_i2c_acpi_ids),
#endif /* CONFIG_ACPI */
}, },
}; };