* [PATCH v2] i2c: don't expose function which is only used internally
@ 2022-02-10 21:33 Wolfram Sang
2022-02-11 11:02 ` Niklas Söderlund
2022-02-15 9:01 ` Wolfram Sang
0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2022-02-10 21:33 UTC (permalink / raw)
To: linux-i2c; +Cc: linux-renesas-soc, Wolfram Sang
i2c_setup_smbus_alert() is only needed within the I2C core, so no need
to expose it to other modules.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Based on i2c/for-mergewindow. Build bots are happy.
Change since v1:
not only remove the symbol, also move the declaration from a public
header to the private one.
drivers/i2c/i2c-core-smbus.c | 1 -
drivers/i2c/i2c-core.h | 9 +++++++++
include/linux/i2c-smbus.h | 8 --------
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/i2c/i2c-core-smbus.c b/drivers/i2c/i2c-core-smbus.c
index 304c2c8fee68..053b215308c4 100644
--- a/drivers/i2c/i2c-core-smbus.c
+++ b/drivers/i2c/i2c-core-smbus.c
@@ -716,5 +716,4 @@ int i2c_setup_smbus_alert(struct i2c_adapter *adapter)
return PTR_ERR_OR_ZERO(i2c_new_smbus_alert_device(adapter, NULL));
}
-EXPORT_SYMBOL_GPL(i2c_setup_smbus_alert);
#endif
diff --git a/drivers/i2c/i2c-core.h b/drivers/i2c/i2c-core.h
index 8ce261167a2d..87e2c914f1c5 100644
--- a/drivers/i2c/i2c-core.h
+++ b/drivers/i2c/i2c-core.h
@@ -86,3 +86,12 @@ void of_i2c_register_devices(struct i2c_adapter *adap);
static inline void of_i2c_register_devices(struct i2c_adapter *adap) { }
#endif
extern struct notifier_block i2c_of_notifier;
+
+#if IS_ENABLED(CONFIG_I2C_SMBUS)
+int i2c_setup_smbus_alert(struct i2c_adapter *adap);
+#else
+static inline int i2c_setup_smbus_alert(struct i2c_adapter *adap)
+{
+ return 0;
+}
+#endif
diff --git a/include/linux/i2c-smbus.h b/include/linux/i2c-smbus.h
index 95cf902e0bda..ced1c6ead52a 100644
--- a/include/linux/i2c-smbus.h
+++ b/include/linux/i2c-smbus.h
@@ -30,14 +30,6 @@ struct i2c_client *i2c_new_smbus_alert_device(struct i2c_adapter *adapter,
struct i2c_smbus_alert_setup *setup);
int i2c_handle_smbus_alert(struct i2c_client *ara);
-#if IS_ENABLED(CONFIG_I2C_SMBUS)
-int i2c_setup_smbus_alert(struct i2c_adapter *adap);
-#else
-static inline int i2c_setup_smbus_alert(struct i2c_adapter *adap)
-{
- return 0;
-}
-#endif
#if IS_ENABLED(CONFIG_I2C_SMBUS) && IS_ENABLED(CONFIG_I2C_SLAVE)
struct i2c_client *i2c_new_slave_host_notify_device(struct i2c_adapter *adapter);
void i2c_free_slave_host_notify_device(struct i2c_client *client);
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] i2c: don't expose function which is only used internally
2022-02-10 21:33 [PATCH v2] i2c: don't expose function which is only used internally Wolfram Sang
@ 2022-02-11 11:02 ` Niklas Söderlund
2022-02-15 9:01 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Niklas Söderlund @ 2022-02-11 11:02 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, linux-renesas-soc
Hi Wolfram,
Thanks for your work.
On 2022-02-10 22:33:41 +0100, Wolfram Sang wrote:
> i2c_setup_smbus_alert() is only needed within the I2C core, so no need
> to expose it to other modules.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Looks good,
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
>
> Based on i2c/for-mergewindow. Build bots are happy.
>
> Change since v1:
>
> not only remove the symbol, also move the declaration from a public
> header to the private one.
>
> drivers/i2c/i2c-core-smbus.c | 1 -
> drivers/i2c/i2c-core.h | 9 +++++++++
> include/linux/i2c-smbus.h | 8 --------
> 3 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core-smbus.c b/drivers/i2c/i2c-core-smbus.c
> index 304c2c8fee68..053b215308c4 100644
> --- a/drivers/i2c/i2c-core-smbus.c
> +++ b/drivers/i2c/i2c-core-smbus.c
> @@ -716,5 +716,4 @@ int i2c_setup_smbus_alert(struct i2c_adapter *adapter)
>
> return PTR_ERR_OR_ZERO(i2c_new_smbus_alert_device(adapter, NULL));
> }
> -EXPORT_SYMBOL_GPL(i2c_setup_smbus_alert);
> #endif
> diff --git a/drivers/i2c/i2c-core.h b/drivers/i2c/i2c-core.h
> index 8ce261167a2d..87e2c914f1c5 100644
> --- a/drivers/i2c/i2c-core.h
> +++ b/drivers/i2c/i2c-core.h
> @@ -86,3 +86,12 @@ void of_i2c_register_devices(struct i2c_adapter *adap);
> static inline void of_i2c_register_devices(struct i2c_adapter *adap) { }
> #endif
> extern struct notifier_block i2c_of_notifier;
> +
> +#if IS_ENABLED(CONFIG_I2C_SMBUS)
> +int i2c_setup_smbus_alert(struct i2c_adapter *adap);
> +#else
> +static inline int i2c_setup_smbus_alert(struct i2c_adapter *adap)
> +{
> + return 0;
> +}
> +#endif
> diff --git a/include/linux/i2c-smbus.h b/include/linux/i2c-smbus.h
> index 95cf902e0bda..ced1c6ead52a 100644
> --- a/include/linux/i2c-smbus.h
> +++ b/include/linux/i2c-smbus.h
> @@ -30,14 +30,6 @@ struct i2c_client *i2c_new_smbus_alert_device(struct i2c_adapter *adapter,
> struct i2c_smbus_alert_setup *setup);
> int i2c_handle_smbus_alert(struct i2c_client *ara);
>
> -#if IS_ENABLED(CONFIG_I2C_SMBUS)
> -int i2c_setup_smbus_alert(struct i2c_adapter *adap);
> -#else
> -static inline int i2c_setup_smbus_alert(struct i2c_adapter *adap)
> -{
> - return 0;
> -}
> -#endif
> #if IS_ENABLED(CONFIG_I2C_SMBUS) && IS_ENABLED(CONFIG_I2C_SLAVE)
> struct i2c_client *i2c_new_slave_host_notify_device(struct i2c_adapter *adapter);
> void i2c_free_slave_host_notify_device(struct i2c_client *client);
> --
> 2.30.2
>
--
Kind Regards,
Niklas Söderlund
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] i2c: don't expose function which is only used internally
2022-02-10 21:33 [PATCH v2] i2c: don't expose function which is only used internally Wolfram Sang
2022-02-11 11:02 ` Niklas Söderlund
@ 2022-02-15 9:01 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2022-02-15 9:01 UTC (permalink / raw)
To: linux-i2c; +Cc: linux-renesas-soc
[-- Attachment #1: Type: text/plain, Size: 275 bytes --]
On Thu, Feb 10, 2022 at 10:33:41PM +0100, Wolfram Sang wrote:
> i2c_setup_smbus_alert() is only needed within the I2C core, so no need
> to expose it to other modules.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-15 9:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-10 21:33 [PATCH v2] i2c: don't expose function which is only used internally Wolfram Sang
2022-02-11 11:02 ` Niklas Söderlund
2022-02-15 9:01 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox