diff options
| author | Jarkko Nikula <jarkko.nikula@linux.intel.com> | 2014-12-18 08:04:20 -0500 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2014-12-22 15:17:23 -0500 |
| commit | 7566bcc76b15186172c4db0414cf30c8a61e4a73 (patch) | |
| tree | 2bfd10720184cd1c6a1f9d9bbce978f0b214cca5 | |
| parent | 2db73d4482da9bd979edee345e95bb3a88441b30 (diff) | |
spi: pxa2xx: Move is_lpss_ssp() tests to caller
Move is_lpss_ssp() tests from functions to caller. Although this aims to
improve readability it also saves a few code bytes on x86.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | drivers/spi/spi-pxa2xx.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index e1dc861857f2..cc08500242c4 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c | |||
| @@ -251,9 +251,6 @@ static void lpss_ssp_setup(struct driver_data *drv_data) | |||
| 251 | unsigned offset = 0x400; | 251 | unsigned offset = 0x400; |
| 252 | u32 value, orig; | 252 | u32 value, orig; |
| 253 | 253 | ||
| 254 | if (!is_lpss_ssp(drv_data)) | ||
| 255 | return; | ||
| 256 | |||
| 257 | /* | 254 | /* |
| 258 | * Perform auto-detection of the LPSS SSP private registers. They | 255 | * Perform auto-detection of the LPSS SSP private registers. They |
| 259 | * can be either at 1k or 2k offset from the base address. | 256 | * can be either at 1k or 2k offset from the base address. |
| @@ -302,9 +299,6 @@ static void lpss_ssp_cs_control(struct driver_data *drv_data, bool enable) | |||
| 302 | { | 299 | { |
| 303 | u32 value; | 300 | u32 value; |
| 304 | 301 | ||
| 305 | if (!is_lpss_ssp(drv_data)) | ||
| 306 | return; | ||
| 307 | |||
| 308 | value = __lpss_ssp_read_priv(drv_data, SPI_CS_CONTROL); | 302 | value = __lpss_ssp_read_priv(drv_data, SPI_CS_CONTROL); |
| 309 | if (enable) | 303 | if (enable) |
| 310 | value &= ~SPI_CS_CONTROL_CS_HIGH; | 304 | value &= ~SPI_CS_CONTROL_CS_HIGH; |
| @@ -332,7 +326,8 @@ static void cs_assert(struct driver_data *drv_data) | |||
| 332 | return; | 326 | return; |
| 333 | } | 327 | } |
| 334 | 328 | ||
| 335 | lpss_ssp_cs_control(drv_data, true); | 329 | if (is_lpss_ssp(drv_data)) |
| 330 | lpss_ssp_cs_control(drv_data, true); | ||
| 336 | } | 331 | } |
| 337 | 332 | ||
| 338 | static void cs_deassert(struct driver_data *drv_data) | 333 | static void cs_deassert(struct driver_data *drv_data) |
| @@ -352,7 +347,8 @@ static void cs_deassert(struct driver_data *drv_data) | |||
| 352 | return; | 347 | return; |
| 353 | } | 348 | } |
| 354 | 349 | ||
| 355 | lpss_ssp_cs_control(drv_data, false); | 350 | if (is_lpss_ssp(drv_data)) |
| 351 | lpss_ssp_cs_control(drv_data, false); | ||
| 356 | } | 352 | } |
| 357 | 353 | ||
| 358 | int pxa2xx_spi_flush(struct driver_data *drv_data) | 354 | int pxa2xx_spi_flush(struct driver_data *drv_data) |
| @@ -1415,7 +1411,8 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) | |||
| 1415 | if (!is_quark_x1000_ssp(drv_data)) | 1411 | if (!is_quark_x1000_ssp(drv_data)) |
| 1416 | write_SSPSP(0, drv_data->ioaddr); | 1412 | write_SSPSP(0, drv_data->ioaddr); |
| 1417 | 1413 | ||
| 1418 | lpss_ssp_setup(drv_data); | 1414 | if (is_lpss_ssp(drv_data)) |
| 1415 | lpss_ssp_setup(drv_data); | ||
| 1419 | 1416 | ||
| 1420 | tasklet_init(&drv_data->pump_transfers, pump_transfers, | 1417 | tasklet_init(&drv_data->pump_transfers, pump_transfers, |
| 1421 | (unsigned long)drv_data); | 1418 | (unsigned long)drv_data); |
