diff mbox series

[v2,2/3] i2c: Fix conditional for substituting empty ACPI functions

Message ID 20240802152215.20831-3-rf@opensource.cirrus.com
State New
Headers show
Series ALSA: Add support for new HP G12 laptops | expand

Commit Message

Richard Fitzgerald Aug. 2, 2024, 3:22 p.m. UTC
Add IS_ENABLED(CONFIG_I2C) to the conditional around a bunch of ACPI
functions.

The conditional around these functions depended only on CONFIG_ACPI.
But the functions are implemented in I2C core, so are only present if
CONFIG_I2C is enabled.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
Changes since V1:
- This patch is new in V2.

 include/linux/i2c.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wolfram Sang Aug. 4, 2024, 2:34 p.m. UTC | #1
On Fri, Aug 02, 2024 at 04:22:14PM +0100, Richard Fitzgerald wrote:
> Add IS_ENABLED(CONFIG_I2C) to the conditional around a bunch of ACPI
> functions.
> 
> The conditional around these functions depended only on CONFIG_ACPI.
> But the functions are implemented in I2C core, so are only present if
> CONFIG_I2C is enabled.
> 
> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>

Applied to for-current, thanks!
diff mbox series

Patch

diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 07e33bbc9256..7eedd0c662da 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -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)
+#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(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);