diff options
| author | Eric Wu <kunjinkao.jp@gmail.com> | 2026-04-27 23:54:21 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-05-04 16:21:34 +0200 |
| commit | 4f44225a9b7aa99325fc0f4ea399b3f2f9595737 (patch) | |
| tree | c9c5856718751eca81e1b08d6c3185164e96df2b /arch/mips/include | |
| parent | 4776aefb5aa5c2c5250597b95ab8d490e6b783cf (diff) | |
| download | lwn-4f44225a9b7aa99325fc0f4ea399b3f2f9595737.tar.gz lwn-4f44225a9b7aa99325fc0f4ea399b3f2f9595737.zip | |
staging: octeon: convert cvmx_spi_mode_t from typedef to plain enum
The Linux kernel coding style discourages the use of typedefs for
enums. Convert cvmx_spi_mode_t to a plain 'enum cvmx_spi_mode' and
update all users across the MIPS Octeon architecture code and the
staging driver stubs.
This is part of a series converting all remaining enum typedefs in
the octeon subsystem to plain enums, improving compliance with the
kernel coding style.
No functional change.
Signed-off-by: Eric Wu <kunjinkao.jp@gmail.com>
Link: https://patch.msgid.link/20260427155427.668540-2-kunjinkao.jp@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/mips/include')
| -rw-r--r-- | arch/mips/include/asm/octeon/cvmx-spi.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/arch/mips/include/asm/octeon/cvmx-spi.h b/arch/mips/include/asm/octeon/cvmx-spi.h index d5038cc4b475..88f7e59a396b 100644 --- a/arch/mips/include/asm/octeon/cvmx-spi.h +++ b/arch/mips/include/asm/octeon/cvmx-spi.h @@ -36,35 +36,35 @@ /* CSR typedefs have been moved to cvmx-csr-*.h */ -typedef enum { +enum cvmx_spi_mode { CVMX_SPI_MODE_UNKNOWN = 0, CVMX_SPI_MODE_TX_HALFPLEX = 1, CVMX_SPI_MODE_RX_HALFPLEX = 2, CVMX_SPI_MODE_DUPLEX = 3 -} cvmx_spi_mode_t; +}; /** Callbacks structure to customize SPI4 initialization sequence */ typedef struct { /** Called to reset SPI4 DLL */ - int (*reset_cb) (int interface, cvmx_spi_mode_t mode); + int (*reset_cb)(int interface, enum cvmx_spi_mode mode); /** Called to setup calendar */ - int (*calendar_setup_cb) (int interface, cvmx_spi_mode_t mode, - int num_ports); + int (*calendar_setup_cb)(int interface, enum cvmx_spi_mode mode, + int num_ports); /** Called for Tx and Rx clock detection */ - int (*clock_detect_cb) (int interface, cvmx_spi_mode_t mode, - int timeout); + int (*clock_detect_cb)(int interface, enum cvmx_spi_mode mode, + int timeout); /** Called to perform link training */ - int (*training_cb) (int interface, cvmx_spi_mode_t mode, int timeout); + int (*training_cb)(int interface, enum cvmx_spi_mode mode, int timeout); /** Called for calendar data synchronization */ - int (*calendar_sync_cb) (int interface, cvmx_spi_mode_t mode, - int timeout); + int (*calendar_sync_cb)(int interface, enum cvmx_spi_mode mode, + int timeout); /** Called when interface is up */ - int (*interface_up_cb) (int interface, cvmx_spi_mode_t mode); + int (*interface_up_cb)(int interface, enum cvmx_spi_mode mode); } cvmx_spi_callbacks_t; @@ -94,7 +94,7 @@ static inline int cvmx_spi_is_spi_interface(int interface) * * Returns Zero on success, negative of failure. */ -extern int cvmx_spi_start_interface(int interface, cvmx_spi_mode_t mode, +extern int cvmx_spi_start_interface(int interface, enum cvmx_spi_mode mode, int timeout, int num_ports); /** @@ -110,7 +110,7 @@ extern int cvmx_spi_start_interface(int interface, cvmx_spi_mode_t mode, * @timeout: Timeout to wait for clock synchronization in seconds * Returns Zero on success, negative of failure. */ -extern int cvmx_spi_restart_interface(int interface, cvmx_spi_mode_t mode, +extern int cvmx_spi_restart_interface(int interface, enum cvmx_spi_mode mode, int timeout); /** @@ -180,7 +180,7 @@ extern void cvmx_spi_set_callbacks(cvmx_spi_callbacks_t *new_callbacks); * Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -extern int cvmx_spi_reset_cb(int interface, cvmx_spi_mode_t mode); +extern int cvmx_spi_reset_cb(int interface, enum cvmx_spi_mode mode); /** * Callback to setup calendar and miscellaneous settings before clock @@ -197,7 +197,7 @@ extern int cvmx_spi_reset_cb(int interface, cvmx_spi_mode_t mode); * Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -extern int cvmx_spi_calendar_setup_cb(int interface, cvmx_spi_mode_t mode, +extern int cvmx_spi_calendar_setup_cb(int interface, enum cvmx_spi_mode mode, int num_ports); /** @@ -214,7 +214,7 @@ extern int cvmx_spi_calendar_setup_cb(int interface, cvmx_spi_mode_t mode, * Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -extern int cvmx_spi_clock_detect_cb(int interface, cvmx_spi_mode_t mode, +extern int cvmx_spi_clock_detect_cb(int interface, enum cvmx_spi_mode mode, int timeout); /** @@ -231,7 +231,7 @@ extern int cvmx_spi_clock_detect_cb(int interface, cvmx_spi_mode_t mode, * Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -extern int cvmx_spi_training_cb(int interface, cvmx_spi_mode_t mode, +extern int cvmx_spi_training_cb(int interface, enum cvmx_spi_mode mode, int timeout); /** @@ -248,7 +248,7 @@ extern int cvmx_spi_training_cb(int interface, cvmx_spi_mode_t mode, * Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -extern int cvmx_spi_calendar_sync_cb(int interface, cvmx_spi_mode_t mode, +extern int cvmx_spi_calendar_sync_cb(int interface, enum cvmx_spi_mode mode, int timeout); /** @@ -264,6 +264,6 @@ extern int cvmx_spi_calendar_sync_cb(int interface, cvmx_spi_mode_t mode, * Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -extern int cvmx_spi_interface_up_cb(int interface, cvmx_spi_mode_t mode); +extern int cvmx_spi_interface_up_cb(int interface, enum cvmx_spi_mode mode); #endif /* __CVMX_SPI_H__ */ |
