aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-pxa2xx.c
diff options
context:
space:
mode:
authorJarkko Nikula <jarkko.nikula@linux.intel.com>2015-10-22 09:44:41 -0400
committerMark Brown <broonie@kernel.org>2015-10-22 19:56:05 -0400
commit3b8b6d05942ef5dd952674e7420600f762166e22 (patch)
treed3a587aa5f23a17ab5a22a60da2eb97c5def32f7 /drivers/spi/spi-pxa2xx.c
parentd2c2f6a47633a36bc8db8c802f7c284da36a7a53 (diff)
spi: pxa2xx: Convert unique ID string of ACPI device as unsigned integer
Andy noticed numeric unique device ID is unsigned integer so convert it using kstrtouint(). Actually integer in ACPI 2.0 and later is 64 bits litte-endian unsigned integer but quite certainly having so big value here would mean something extra than just the SPI bus number so it won't hurt to assume only lower 32 bits carry the bus number for now. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-pxa2xx.c')
-rw-r--r--drivers/spi/spi-pxa2xx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index 4fddc2a37a81..db9016bbd904 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1305,7 +1305,8 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
1305 struct resource *res; 1305 struct resource *res;
1306 const struct acpi_device_id *adev_id = NULL; 1306 const struct acpi_device_id *adev_id = NULL;
1307 const struct pci_device_id *pcidev_id = NULL; 1307 const struct pci_device_id *pcidev_id = NULL;
1308 int devid, type; 1308 unsigned int devid;
1309 int type;
1309 1310
1310 adev = ACPI_COMPANION(&pdev->dev); 1311 adev = ACPI_COMPANION(&pdev->dev);
1311 if (!adev) 1312 if (!adev)
@@ -1352,7 +1353,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
1352 ssp->pdev = pdev; 1353 ssp->pdev = pdev;
1353 1354
1354 ssp->port_id = -1; 1355 ssp->port_id = -1;
1355 if (adev->pnp.unique_id && !kstrtoint(adev->pnp.unique_id, 0, &devid)) 1356 if (adev->pnp.unique_id && !kstrtouint(adev->pnp.unique_id, 0, &devid))
1356 ssp->port_id = devid; 1357 ssp->port_id = devid;
1357 1358
1358 pdata->num_chipselect = 1; 1359 pdata->num_chipselect = 1;