2022-10-20 23:21:00

by Adam Borowski

[permalink] [raw]
Subject: [PATCH 5/6] 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: be18c5ede25da39a0eda541f6de3620a30cf731f
Signed-off-by: Adam Borowski <[email protected]>
---
drivers/i2c/busses/Kconfig | 1 +
drivers/i2c/busses/i2c-mlxbf.c | 9 ---------
2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 264e780ae32e..e50f9603d189 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -764,6 +764,7 @@ config I2C_LPC2K
config I2C_MLXBF
tristate "Mellanox BlueField I2C controller"
depends on MELLANOX_PLATFORM && ARM64
+ depends on ACPI
select I2C_SLAVE
help
Enabling this option will add I2C SMBus support for Mellanox BlueField
diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
index e68e775f187e..1810d5791b3d 100644
--- a/drivers/i2c/busses/i2c-mlxbf.c
+++ b/drivers/i2c/busses/i2c-mlxbf.c
@@ -2247,7 +2247,6 @@ static struct i2c_adapter_quirks mlxbf_i2c_quirks = {
.max_write_len = MLXBF_I2C_MASTER_DATA_W_LENGTH,
};

-#ifdef CONFIG_ACPI
static const struct acpi_device_id mlxbf_i2c_acpi_ids[] = {
{ "MLNXBF03", (kernel_ulong_t)&mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_1] },
{ "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;
}
-#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)
{
@@ -2490,9 +2483,7 @@ static struct platform_driver mlxbf_i2c_driver = {
.remove = mlxbf_i2c_remove,
.driver = {
.name = "i2c-mlxbf",
-#ifdef CONFIG_ACPI
.acpi_match_table = ACPI_PTR(mlxbf_i2c_acpi_ids),
-#endif /* CONFIG_ACPI */
},
};

--
2.37.2.609.g9ff673ca1a


2022-10-21 06:50:34

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 5/6] i2c: mlxbf: depend on ACPI; clean away ifdeffage

On Mon, Oct 10, 2022 at 08:33:51PM +0200, Adam Borowski wrote:
> 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: be18c5ede25da39a0eda541f6de3620a30cf731f
> Signed-off-by: Adam Borowski <[email protected]>

Applied to for-current, thanks!

@Asmaa, @Khalil: normally, I will not skip the driver maintainer's ack
but wait for it. I'd like to make an exception this time because I don't
want to get another dozen of patches fixing this build warning. Since
Asmaa already acked a similar patch, I hope this is okay with you.


Attachments:
(No filename) (658.00 B)
signature.asc (849.00 B)
Download all attachments

2022-10-21 07:12:39

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 5/6] i2c: mlxbf: depend on ACPI; clean away ifdeffage


> > Fixes: be18c5ede25da39a0eda541f6de3620a30cf731f

BTW this has to look like:

Fixes: be18c5ede25d ("i2c: mlxbf: remove device tree support")

checkpatch will warn you about it. This time, I fixed it for you.


Attachments:
(No filename) (222.00 B)
signature.asc (849.00 B)
Download all attachments

2022-10-21 13:32:22

by Asmaa Mnebhi

[permalink] [raw]
Subject: RE: [PATCH 5/6] i2c: mlxbf: depend on ACPI; clean away ifdeffage

LGTM. Thanks Wolfram!
Acked-By: Asmaa Mnebhi <[email protected]>

-----Original Message-----
From: Wolfram Sang <[email protected]>
Sent: Friday, October 21, 2022 2:43 AM
To: Adam Borowski <[email protected]>
Cc: Khalil Blaiech <[email protected]>; Asmaa Mnebhi <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH 5/6] i2c: mlxbf: depend on ACPI; clean away ifdeffage

On Mon, Oct 10, 2022 at 08:33:51PM +0200, Adam Borowski wrote:
> 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: be18c5ede25da39a0eda541f6de3620a30cf731f
> Signed-off-by: Adam Borowski <[email protected]>

Applied to for-current, thanks!

@Asmaa, @Khalil: normally, I will not skip the driver maintainer's ack but wait for it. I'd like to make an exception this time because I don't want to get another dozen of patches fixing this build warning. Since Asmaa already acked a similar patch, I hope this is okay with you.

2022-10-21 14:28:52

by Khalil Blaiech

[permalink] [raw]
Subject: RE: [PATCH 5/6] i2c: mlxbf: depend on ACPI; clean away ifdeffage

Fine with me. Thanks Wolfram.

Acked-By: Khalil Blaiech <[email protected]>

Thanks,
-Khalil

-----Original Message-----
From: Wolfram Sang <[email protected]>
Sent: Friday, October 21, 2022 2:43 AM
To: Adam Borowski <[email protected]>
Cc: Khalil Blaiech <[email protected]>; Asmaa Mnebhi <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH 5/6] i2c: mlxbf: depend on ACPI; clean away ifdeffage

On Mon, Oct 10, 2022 at 08:33:51PM +0200, Adam Borowski wrote:
> 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: be18c5ede25da39a0eda541f6de3620a30cf731f
> Signed-off-by: Adam Borowski <[email protected]>

Applied to for-current, thanks!

@Asmaa, @Khalil: normally, I will not skip the driver maintainer's ack but wait for it. I'd like to make an exception this time because I don't want to get another dozen of patches fixing this build warning. Since Asmaa already acked a similar patch, I hope this is okay with you.