Skip to contentSkip to conversation

i2c: Use IS_REACHABLE() for substituting empty ACPI functions

PATCH Applied Richard Fitzgerald 3 participants 6 messages Aug 14, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: Use IS_REACHABLE() for substituting empty ACPI functions

Replace IS_ENABLED() with IS_REACHABLE() to substitute empty stubs for:

    i2c_acpi_get_i2c_resource()
    i2c_acpi_client_count()
    i2c_acpi_find_bus_speed()
    i2c_acpi_new_device_by_fwnode()
    i2c_adapter *i2c_acpi_find_adapter_by_handle()
    i2c_acpi_waive_d0_probe()

commit f17c06c6608a ("i2c: Fix conditional for substituting empty ACPI functions") partially fixed this conditional to depend on CONFIG_I2C, but used IS_ENABLED(), which is wrong since CONFIG_I2C is tristate.

CONFIG_ACPI is boolean but let's also change it to use IS_REACHABLE() to future-proof it against becoming tristate.

Somehow despite testing various combinations of CONFIG_I2C and CONFIG_ACPI we missed the combination CONFIG_I2C=m, CONFIG_ACPI=y.

Fixes f17c06c6608a ("i2c: Fix conditional for substituting empty ACPI functions")
---
 include/linux/i2c.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/i2c.h +1 -1
index 7eedd0c662da..377def497298 100644
@@ -1066,7 +1066,7 @@ static inline int of_i2c_get_board_info(struct device *dev,
 struct acpi_resource;
 struct acpi_resource_i2c_serialbus;
 
-#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_I2C)
+#if IS_REACHABLE(CONFIG_ACPI) && IS_REACHABLE(CONFIG_I2C)
 bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares,
 			       struct acpi_resource_i2c_serialbus **i2c);
 int i2c_acpi_client_count(struct acpi_device *adev);
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Richard Fitzgerald

Replace IS_ENABLED() with IS_REACHABLE() to substitute empty stubs for:

    i2c_acpi_get_i2c_resource()
    i2c_acpi_client_count()
    i2c_acpi_find_bus_speed()
    i2c_acpi_new_device_by_fwnode()
    i2c_adapter *i2c_acpi_find_adapter_by_handle()
    i2c_acpi_waive_d0_probe()

commit f17c06c6608a ("i2c: Fix conditional for substituting empty ACPI functions") partially fixed this conditional to depend on CONFIG_I2C, but used IS_ENABLED(), which is wrong since CONFIG_I2C is tristate.

CONFIG_ACPI is boolean but let's also change it to use IS_REACHABLE() to future-proof it against becoming tristate.

Quoted 7 lines

Somehow despite testing various combinations of CONFIG_I2C and CONFIG_ACPI we missed the combination CONFIG_I2C=m, CONFIG_ACPI=y.

Fixes f17c06c6608a ("i2c: Fix conditional for substituting empty ACPI functions")

I suppose Wolfram will take this?

thanks,

Takashi

#2 lore raw
Quoted 9 lines
Quoted 5 lines
Fixes f17c06c6608a ("i2c: Fix conditional for substituting empty ACPI functions")

I suppose Wolfram will take this?

Yes, for rc4. I wonder why buildbot did not spot it for the branch I submitted to rc3. Things happen, I guess...

#3 lore raw
Quoted 7 lines · Wolfram Sang
Quoted 7 lines
Quoted 6 lines
Fixes f17c06c6608a ("i2c: Fix conditional for substituting empty ACPI functions")
Quoted 6 lines
Quoted 3 lines

I suppose Wolfram will take this?

Yes, for rc4. I wonder why buildbot did not spot it for the branch I submitted to rc3. Things happen, I guess...

Maybe because there was no user that can hit with randconfig. It was a preliminary fix for the change I recently put after the rc3 release, and now it surfaced.

thanks,

Takashi

#4 lore raw
Quoted 3 lines

It was a preliminary fix for the change I recently put after the rc3 release, and now it surfaced.

Ah, that's an explanation. Thanks!

Applied
#5 lore raw
In reply to Richard Fitzgerald
Quoted 15 lines · Richard Fitzgerald

Replace IS_ENABLED() with IS_REACHABLE() to substitute empty stubs for:

    i2c_acpi_get_i2c_resource()
    i2c_acpi_client_count()
    i2c_acpi_find_bus_speed()
    i2c_acpi_new_device_by_fwnode()
    i2c_adapter *i2c_acpi_find_adapter_by_handle()
    i2c_acpi_waive_d0_probe()

commit f17c06c6608a ("i2c: Fix conditional for substituting empty ACPI functions") partially fixed this conditional to depend on CONFIG_I2C, but used IS_ENABLED(), which is wrong since CONFIG_I2C is tristate.

CONFIG_ACPI is boolean but let's also change it to use IS_REACHABLE() to future-proof it against becoming tristate.

Quoted 7 lines

Somehow despite testing various combinations of CONFIG_I2C and CONFIG_ACPI we missed the combination CONFIG_I2C=m, CONFIG_ACPI=y.

Fixes f17c06c6608a ("i2c: Fix conditional for substituting empty ACPI functions")

Applied to for-current, thanks!