Commit 365e856e authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown

spi: pxa2xx: Convert pxa2xx_spi_get_port_id() to take struct device

This is preparatory patch before converting to use device_get_match_data() API.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20191018105429.82782-3-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5ce25705
...@@ -1476,11 +1476,13 @@ MODULE_DEVICE_TABLE(of, pxa2xx_spi_of_match); ...@@ -1476,11 +1476,13 @@ MODULE_DEVICE_TABLE(of, pxa2xx_spi_of_match);
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
static int pxa2xx_spi_get_port_id(struct acpi_device *adev) static int pxa2xx_spi_get_port_id(struct device *dev)
{ {
struct acpi_device *adev;
unsigned int devid; unsigned int devid;
int port_id = -1; int port_id = -1;
adev = ACPI_COMPANION(dev);
if (adev && adev->pnp.unique_id && if (adev && adev->pnp.unique_id &&
!kstrtouint(adev->pnp.unique_id, 0, &devid)) !kstrtouint(adev->pnp.unique_id, 0, &devid))
port_id = devid; port_id = devid;
...@@ -1489,7 +1491,7 @@ static int pxa2xx_spi_get_port_id(struct acpi_device *adev) ...@@ -1489,7 +1491,7 @@ static int pxa2xx_spi_get_port_id(struct acpi_device *adev)
#else /* !CONFIG_ACPI */ #else /* !CONFIG_ACPI */
static int pxa2xx_spi_get_port_id(struct acpi_device *adev) static int pxa2xx_spi_get_port_id(struct device *dev)
{ {
return -1; return -1;
} }
...@@ -1568,7 +1570,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) ...@@ -1568,7 +1570,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
ssp->irq = platform_get_irq(pdev, 0); ssp->irq = platform_get_irq(pdev, 0);
ssp->type = type; ssp->type = type;
ssp->dev = &pdev->dev; ssp->dev = &pdev->dev;
ssp->port_id = pxa2xx_spi_get_port_id(adev); ssp->port_id = pxa2xx_spi_get_port_id(&pdev->dev);
pdata->is_slave = of_property_read_bool(pdev->dev.of_node, "spi-slave"); pdata->is_slave = of_property_read_bool(pdev->dev.of_node, "spi-slave");
pdata->num_chipselect = 1; pdata->num_chipselect = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment