public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] i2c: header: improve description of i2c_algorithm
@ 2024-07-16  8:36 Wolfram Sang
  2024-07-16  8:36 ` [PATCH 1/2] i2c: header: remove unneeded stuff regarding i2c_algorithm Wolfram Sang
  2024-07-16  8:36 ` [PATCH 2/2] i2c: header: improve kdoc for i2c_algorithm Wolfram Sang
  0 siblings, 2 replies; 5+ messages in thread
From: Wolfram Sang @ 2024-07-16  8:36 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Wolfram Sang, linux-i2c, linux-kernel

Here are two patches to remove bitrot from explanation of struct
i2c_algorithm and to ease understanding.

Based on my i2c/for-mergewindow branch.


Wolfram Sang (2):
  i2c: header: remove unneeded stuff regarding i2c_algorithm
  i2c: header: improve kdoc for i2c_algorithm

 include/linux/i2c.h | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

-- 
2.43.0


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

* [PATCH 1/2] i2c: header: remove unneeded stuff regarding i2c_algorithm
  2024-07-16  8:36 [PATCH 0/2] i2c: header: improve description of i2c_algorithm Wolfram Sang
@ 2024-07-16  8:36 ` Wolfram Sang
  2024-07-20 11:20   ` Wolfram Sang
  2024-07-16  8:36 ` [PATCH 2/2] i2c: header: improve kdoc for i2c_algorithm Wolfram Sang
  1 sibling, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2024-07-16  8:36 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Wolfram Sang, linux-i2c, linux-kernel

The forward declaration is not needed anymore. The sentence about
"following structs" became obsolete when struct i2c_algorithm became a
kdoc. The paragraph about return values can go because we have this
information in kdoc already.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 include/linux/i2c.h | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index e9cc14b1f9a1..1e34b486f604 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -30,7 +30,6 @@ extern const struct device_type i2c_client_type;
 /* --- General options ------------------------------------------------	*/
 
 struct i2c_msg;
-struct i2c_algorithm;
 struct i2c_adapter;
 struct i2c_client;
 struct i2c_driver;
@@ -533,8 +532,6 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info,
  * @reg_slave: deprecated, use @reg_target
  * @unreg_slave: deprecated, use @unreg_target
  *
- *
- * The following structs are for those who like to implement new bus drivers:
  * i2c_algorithm is the interface to a class of hardware solutions which can
  * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584
  * to name two of the most common.
@@ -550,9 +547,6 @@ struct i2c_algorithm {
 	 * to NULL. If an adapter algorithm can do SMBus access, set
 	 * smbus_xfer. If set to NULL, the SMBus protocol is simulated
 	 * using common I2C messages.
-	 *
-	 * xfer should return the number of messages successfully
-	 * processed, or a negative value on error
 	 */
 	union {
 		int (*xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs,
-- 
2.43.0


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

* [PATCH 2/2] i2c: header: improve kdoc for i2c_algorithm
  2024-07-16  8:36 [PATCH 0/2] i2c: header: improve description of i2c_algorithm Wolfram Sang
  2024-07-16  8:36 ` [PATCH 1/2] i2c: header: remove unneeded stuff regarding i2c_algorithm Wolfram Sang
@ 2024-07-16  8:36 ` Wolfram Sang
  2024-07-20 11:20   ` Wolfram Sang
  1 sibling, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2024-07-16  8:36 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Wolfram Sang, linux-i2c, linux-kernel

Reword the explanation of @xfer, the old one was confusing and mixing up
terminology. Other than that, capitalize some words correctly and use
full line length.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 include/linux/i2c.h | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 1e34b486f604..8caaa13834bf 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -511,16 +511,15 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info,
 #endif /* I2C_BOARDINFO */
 
 /**
- * struct i2c_algorithm - represent I2C transfer method
- * @xfer: Issue a set of i2c transactions to the given I2C adapter
- *   defined by the msgs array, with num messages available to transfer via
- *   the adapter specified by adap.
- * @xfer_atomic: same as @xfer. Yet, only using atomic context
- *   so e.g. PMICs can be accessed very late before shutdown. Optional.
- * @smbus_xfer: Issue smbus transactions to the given I2C adapter. If this
+ * struct i2c_algorithm - represent I2C transfer methods
+ * @xfer: Transfer a given number of messages defined by the msgs array via
+ *   the specified adapter.
+ * @xfer_atomic: Same as @xfer. Yet, only using atomic context so e.g. PMICs
+ *   can be accessed very late before shutdown. Optional.
+ * @smbus_xfer: Issue SMBus transactions to the given I2C adapter. If this
  *   is not present, then the bus layer will try and convert the SMBus calls
  *   into I2C transfers instead.
- * @smbus_xfer_atomic: same as @smbus_xfer. Yet, only using atomic context
+ * @smbus_xfer_atomic: Same as @smbus_xfer. Yet, only using atomic context
  *   so e.g. PMICs can be accessed very late before shutdown. Optional.
  * @functionality: Return the flags that this algorithm/adapter pair supports
  *   from the ``I2C_FUNC_*`` flags.
-- 
2.43.0


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

* Re: [PATCH 1/2] i2c: header: remove unneeded stuff regarding i2c_algorithm
  2024-07-16  8:36 ` [PATCH 1/2] i2c: header: remove unneeded stuff regarding i2c_algorithm Wolfram Sang
@ 2024-07-20 11:20   ` Wolfram Sang
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2024-07-20 11:20 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: linux-i2c, linux-kernel

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

On Tue, Jul 16, 2024 at 10:36:24AM +0200, Wolfram Sang wrote:
> The forward declaration is not needed anymore. The sentence about
> "following structs" became obsolete when struct i2c_algorithm became a
> kdoc. The paragraph about return values can go because we have this
> information in kdoc already.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Applied to for-current, thanks!


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

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

* Re: [PATCH 2/2] i2c: header: improve kdoc for i2c_algorithm
  2024-07-16  8:36 ` [PATCH 2/2] i2c: header: improve kdoc for i2c_algorithm Wolfram Sang
@ 2024-07-20 11:20   ` Wolfram Sang
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2024-07-20 11:20 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: linux-i2c, linux-kernel

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

On Tue, Jul 16, 2024 at 10:36:25AM +0200, Wolfram Sang wrote:
> Reword the explanation of @xfer, the old one was confusing and mixing up
> terminology. Other than that, capitalize some words correctly and use
> full line length.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Applied to for-current, thanks!


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

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

end of thread, other threads:[~2024-07-20 11:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-16  8:36 [PATCH 0/2] i2c: header: improve description of i2c_algorithm Wolfram Sang
2024-07-16  8:36 ` [PATCH 1/2] i2c: header: remove unneeded stuff regarding i2c_algorithm Wolfram Sang
2024-07-20 11:20   ` Wolfram Sang
2024-07-16  8:36 ` [PATCH 2/2] i2c: header: improve kdoc for i2c_algorithm Wolfram Sang
2024-07-20 11:20   ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox