@@ -36,12 +36,12 @@ struct spi_xcomm {
3636
3737 struct gpio_chip gc ;
3838
39- uint16_t settings ;
40- uint16_t chipselect ;
39+ u16 settings ;
40+ u16 chipselect ;
4141
4242 unsigned int current_speed ;
4343
44- uint8_t buf [63 ];
44+ u8 buf [63 ];
4545};
4646
4747static 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)
8282
8383static int spi_xcomm_sync_config (struct spi_xcomm * spi_xcomm , unsigned int len )
8484{
85- uint16_t settings ;
86- uint8_t * buf = spi_xcomm -> buf ;
85+ u16 settings ;
86+ u8 * buf = spi_xcomm -> buf ;
8787
8888 settings = spi_xcomm -> settings ;
8989 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)
9696}
9797
9898static 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 )
100100{
101101 unsigned long cs = spi_get_chipselect (spi , 0 );
102- uint16_t chipselect = spi_xcomm -> chipselect ;
102+ u16 chipselect = spi_xcomm -> chipselect ;
103103
104104 if (is_active )
105105 chipselect |= BIT (cs );
@@ -110,7 +110,8 @@ static void spi_xcomm_chipselect(struct spi_xcomm *spi_xcomm,
110110}
111111
112112static 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 )
114115{
115116 if (t -> len > 62 )
116117 return - EINVAL ;
@@ -148,7 +149,7 @@ static int spi_xcomm_setup_transfer(struct spi_xcomm *spi_xcomm,
148149}
149150
150151static 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 )
152153{
153154 int ret ;
154155
@@ -159,26 +160,26 @@ static int spi_xcomm_txrx_bufs(struct spi_xcomm *spi_xcomm,
159160 ret = i2c_master_send (spi_xcomm -> i2c , spi_xcomm -> buf , t -> len + 1 );
160161 if (ret < 0 )
161162 return ret ;
162- else if (ret != t -> len + 1 )
163+ if (ret != t -> len + 1 )
163164 return - EIO ;
164165 } else if (t -> rx_buf ) {
165166 ret = i2c_master_recv (spi_xcomm -> i2c , t -> rx_buf , t -> len );
166167 if (ret < 0 )
167168 return ret ;
168- else if (ret != t -> len )
169+ if (ret != t -> len )
169170 return - EIO ;
170171 }
171172
172173 return t -> len ;
173174}
174175
175176static int spi_xcomm_transfer_one (struct spi_controller * host ,
176- struct spi_message * msg )
177+ struct spi_message * msg )
177178{
178179 struct spi_xcomm * spi_xcomm = spi_controller_get_devdata (host );
179180 unsigned int settings = spi_xcomm -> settings ;
180181 struct spi_device * spi = msg -> spi ;
181- unsigned cs_change = 0 ;
182+ unsigned int cs_change = 0 ;
182183 struct spi_transfer * t ;
183184 bool is_first = true;
184185 int status = 0 ;
@@ -187,7 +188,6 @@ static int spi_xcomm_transfer_one(struct spi_controller *host,
187188 spi_xcomm_chipselect (spi_xcomm , spi , true);
188189
189190 list_for_each_entry (t , & msg -> transfers , transfer_list ) {
190-
191191 if (!t -> tx_buf && !t -> rx_buf && t -> len ) {
192192 status = - EINVAL ;
193193 break ;
0 commit comments