linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: use macro IS_ENABLED in header i2c.h
@ 2017-11-01 20:06 Stefan Lengfeld
  2017-11-27 17:32 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Lengfeld @ 2017-11-01 20:06 UTC (permalink / raw)
  To: linux-i2c, wsa

From: Stefan Lengfeld <slengfeld@inovex.de>

Using the macro IS_ENABLED to check the option CONFIG_I2C=(y|m) makes
the code nicer.  No functional change.

Signed-off-by: Stefan Lengfeld <contact@stefanchrist.eu>
---
 include/linux/i2c.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index d501d3956f13..9245a269d160 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -55,7 +55,7 @@ typedef int (*i2c_slave_cb_t)(struct i2c_client *, enum i2c_slave_event, u8 *);
 struct module;
 struct property_entry;
 
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+#if IS_ENABLED(CONFIG_I2C)
 /*
  * The master routines are the ones normally used to transmit data to devices
  * on a bus (or read from them). Apart from two basic transfer functions to
@@ -352,7 +352,7 @@ struct i2c_board_info {
 	.type = dev_type, .addr = (dev_addr)
 
 
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+#if IS_ENABLED(CONFIG_I2C)
 /* Add-on boards should register/unregister their devices; e.g. a board
  * with integrated I2C, a config eeprom, sensors, and a codec that's
  * used in conjunction with the primary hardware.
@@ -704,7 +704,7 @@ i2c_unlock_adapter(struct i2c_adapter *adapter)
 
 /* administration...
  */
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+#if IS_ENABLED(CONFIG_I2C)
 extern int i2c_add_adapter(struct i2c_adapter *);
 extern void i2c_del_adapter(struct i2c_adapter *);
 extern int i2c_add_numbered_adapter(struct i2c_adapter *);
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] i2c: use macro IS_ENABLED in header i2c.h
  2017-11-01 20:06 [PATCH] i2c: use macro IS_ENABLED in header i2c.h Stefan Lengfeld
@ 2017-11-27 17:32 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2017-11-27 17:32 UTC (permalink / raw)
  To: Stefan Lengfeld; +Cc: linux-i2c

[-- Attachment #1: Type: text/plain, Size: 330 bytes --]

On Wed, Nov 01, 2017 at 09:06:41PM +0100, Stefan Lengfeld wrote:
> From: Stefan Lengfeld <slengfeld@inovex.de>
> 
> Using the macro IS_ENABLED to check the option CONFIG_I2C=(y|m) makes
> the code nicer.  No functional change.
> 
> Signed-off-by: Stefan Lengfeld <contact@stefanchrist.eu>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-27 17:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-01 20:06 [PATCH] i2c: use macro IS_ENABLED in header i2c.h Stefan Lengfeld
2017-11-27 17:32 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).