]> www.infradead.org Git - nvme.git/commitdiff
spi: pxa2xx: Remove superflous check for Intel Atom SoCs
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 30 May 2024 15:10:04 +0000 (18:10 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 3 Jun 2024 15:00:01 +0000 (16:00 +0100)
pxa2xx_spi_fw_translate_cs() checks for the ACPI companion device
presence along with the SSP type. But the SSP type is uniquely
determines the case. Hence remove the superflous check.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://msgid.link/r/20240530151117.1130792-9-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-pxa2xx.c

index 9724d94558372743c0035be65fe0a8274db3665e..3c03a8cd9ee64d7c1e8dcf83da50baa62f99191c 100644 (file)
@@ -1393,23 +1393,19 @@ static int pxa2xx_spi_fw_translate_cs(struct spi_controller *controller,
 {
        struct driver_data *drv_data = spi_controller_get_devdata(controller);
 
-       if (has_acpi_companion(drv_data->ssp->dev)) {
-               switch (drv_data->ssp_type) {
-               /*
-                * For Atoms the ACPI DeviceSelection used by the Windows
-                * driver starts from 1 instead of 0 so translate it here
-                * to match what Linux expects.
-                */
-               case LPSS_BYT_SSP:
-               case LPSS_BSW_SSP:
-                       return cs - 1;
+       switch (drv_data->ssp_type) {
+       /*
+        * For some of Intel Atoms the ACPI DeviceSelection used by the Windows
+        * driver starts from 1 instead of 0 so translate it here to match what
+        * Linux expects.
+        */
+       case LPSS_BYT_SSP:
+       case LPSS_BSW_SSP:
+               return cs - 1;
 
-               default:
-                       break;
-               }
+       default:
+               return cs;
        }
-
-       return cs;
 }
 
 static size_t pxa2xx_spi_max_dma_transfer_size(struct spi_device *spi)