@@ -36,12 +36,12 @@ struct spi_xcomm {
36
36
37
37
struct gpio_chip gc ;
38
38
39
- uint16_t settings ;
40
- uint16_t chipselect ;
39
+ u16 settings ;
40
+ u16 chipselect ;
41
41
42
42
unsigned int current_speed ;
43
43
44
- uint8_t buf [63 ];
44
+ u8 buf [63 ];
45
45
};
46
46
47
47
static void spi_xcomm_gpio_set_value (struct gpio_chip * chip ,
@@ -82,8 +82,8 @@ static int spi_xcomm_gpio_add(struct spi_xcomm *spi_xcomm)
82
82
83
83
static int spi_xcomm_sync_config (struct spi_xcomm * spi_xcomm , unsigned int len )
84
84
{
85
- uint16_t settings ;
86
- uint8_t * buf = spi_xcomm -> buf ;
85
+ u16 settings ;
86
+ u8 * buf = spi_xcomm -> buf ;
87
87
88
88
settings = spi_xcomm -> settings ;
89
89
settings |= len << SPI_XCOMM_SETTINGS_LEN_OFFSET ;
@@ -96,10 +96,10 @@ static int spi_xcomm_sync_config(struct spi_xcomm *spi_xcomm, unsigned int len)
96
96
}
97
97
98
98
static void spi_xcomm_chipselect (struct spi_xcomm * spi_xcomm ,
99
- struct spi_device * spi , int is_active )
99
+ struct spi_device * spi , int is_active )
100
100
{
101
101
unsigned long cs = spi_get_chipselect (spi , 0 );
102
- uint16_t chipselect = spi_xcomm -> chipselect ;
102
+ u16 chipselect = spi_xcomm -> chipselect ;
103
103
104
104
if (is_active )
105
105
chipselect |= BIT (cs );
@@ -110,7 +110,8 @@ static void spi_xcomm_chipselect(struct spi_xcomm *spi_xcomm,
110
110
}
111
111
112
112
static int spi_xcomm_setup_transfer (struct spi_xcomm * spi_xcomm ,
113
- struct spi_device * spi , struct spi_transfer * t , unsigned int * settings )
113
+ struct spi_device * spi , struct spi_transfer * t ,
114
+ unsigned int * settings )
114
115
{
115
116
if (t -> len > 62 )
116
117
return - EINVAL ;
@@ -148,7 +149,7 @@ static int spi_xcomm_setup_transfer(struct spi_xcomm *spi_xcomm,
148
149
}
149
150
150
151
static int spi_xcomm_txrx_bufs (struct spi_xcomm * spi_xcomm ,
151
- struct spi_device * spi , struct spi_transfer * t )
152
+ struct spi_device * spi , struct spi_transfer * t )
152
153
{
153
154
int ret ;
154
155
@@ -159,26 +160,26 @@ static int spi_xcomm_txrx_bufs(struct spi_xcomm *spi_xcomm,
159
160
ret = i2c_master_send (spi_xcomm -> i2c , spi_xcomm -> buf , t -> len + 1 );
160
161
if (ret < 0 )
161
162
return ret ;
162
- else if (ret != t -> len + 1 )
163
+ if (ret != t -> len + 1 )
163
164
return - EIO ;
164
165
} else if (t -> rx_buf ) {
165
166
ret = i2c_master_recv (spi_xcomm -> i2c , t -> rx_buf , t -> len );
166
167
if (ret < 0 )
167
168
return ret ;
168
- else if (ret != t -> len )
169
+ if (ret != t -> len )
169
170
return - EIO ;
170
171
}
171
172
172
173
return t -> len ;
173
174
}
174
175
175
176
static int spi_xcomm_transfer_one (struct spi_controller * host ,
176
- struct spi_message * msg )
177
+ struct spi_message * msg )
177
178
{
178
179
struct spi_xcomm * spi_xcomm = spi_controller_get_devdata (host );
179
180
unsigned int settings = spi_xcomm -> settings ;
180
181
struct spi_device * spi = msg -> spi ;
181
- unsigned cs_change = 0 ;
182
+ unsigned int cs_change = 0 ;
182
183
struct spi_transfer * t ;
183
184
bool is_first = true;
184
185
int status = 0 ;
@@ -187,7 +188,6 @@ static int spi_xcomm_transfer_one(struct spi_controller *host,
187
188
spi_xcomm_chipselect (spi_xcomm , spi , true);
188
189
189
190
list_for_each_entry (t , & msg -> transfers , transfer_list ) {
190
-
191
191
if (!t -> tx_buf && !t -> rx_buf && t -> len ) {
192
192
status = - EINVAL ;
193
193
break ;
0 commit comments