Skip to content

Commit

Permalink
spi: pxa2xx: Convert unique ID string of ACPI device as unsigned integer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jarkko Nikula authored and Mark Brown committed Oct 22, 2015
1 parent d2c2f6a commit 3b8b6d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/spi/spi-pxa2xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,8 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
struct resource *res;
const struct acpi_device_id *adev_id = NULL;
const struct pci_device_id *pcidev_id = NULL;
int devid, type;
unsigned int devid;
int type;

adev = ACPI_COMPANION(&pdev->dev);
if (!adev)
Expand Down Expand Up @@ -1352,7 +1353,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
ssp->pdev = pdev;

ssp->port_id = -1;
if (adev->pnp.unique_id && !kstrtoint(adev->pnp.unique_id, 0, &devid))
if (adev->pnp.unique_id && !kstrtouint(adev->pnp.unique_id, 0, &devid))
ssp->port_id = devid;

pdata->num_chipselect = 1;
Expand Down

0 comments on commit 3b8b6d0

Please sign in to comment.