Commit b872e8b1 authored by Mark Brown's avatar Mark Brown

spi: pxa2xx: Minor cleanups

Merge series from Andy Shevchenko <andriy.shevchenko@linux.intel.com>:

This series has a couple of cleanups for the pxa2xx driver.
parents 0a7693a0 6c3c438c
...@@ -1468,7 +1468,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) ...@@ -1468,7 +1468,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
if (pcidev) if (pcidev)
pcidev_id = pci_match_id(pxa2xx_spi_pci_compound_match, pcidev); pcidev_id = pci_match_id(pxa2xx_spi_pci_compound_match, pcidev);
match = device_get_match_data(&pdev->dev); match = device_get_match_data(dev);
if (match) if (match)
type = (enum pxa_ssp_type)match; type = (enum pxa_ssp_type)match;
else if (pcidev_id) else if (pcidev_id)
...@@ -1476,7 +1476,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) ...@@ -1476,7 +1476,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
else else
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata) if (!pdata)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
...@@ -1496,7 +1496,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) ...@@ -1496,7 +1496,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
} }
#endif #endif
ssp->clk = devm_clk_get(&pdev->dev, NULL); ssp->clk = devm_clk_get(dev, NULL);
if (IS_ERR(ssp->clk)) if (IS_ERR(ssp->clk))
return ERR_CAST(ssp->clk); return ERR_CAST(ssp->clk);
...@@ -1505,7 +1505,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) ...@@ -1505,7 +1505,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
return ERR_PTR(ssp->irq); return ERR_PTR(ssp->irq);
ssp->type = type; ssp->type = type;
ssp->dev = &pdev->dev; ssp->dev = dev;
status = acpi_dev_uid_to_integer(ACPI_COMPANION(dev), &uid); status = acpi_dev_uid_to_integer(ACPI_COMPANION(dev), &uid);
if (status) if (status)
...@@ -1513,7 +1513,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) ...@@ -1513,7 +1513,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
else else
ssp->port_id = uid; ssp->port_id = uid;
pdata->is_slave = device_property_read_bool(&pdev->dev, "spi-slave"); pdata->is_slave = device_property_read_bool(dev, "spi-slave");
pdata->num_chipselect = 1; pdata->num_chipselect = 1;
pdata->enable_dma = true; pdata->enable_dma = true;
pdata->dma_burst_size = 1; pdata->dma_burst_size = 1;
...@@ -1806,7 +1806,6 @@ static int pxa2xx_spi_remove(struct platform_device *pdev) ...@@ -1806,7 +1806,6 @@ static int pxa2xx_spi_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static int pxa2xx_spi_suspend(struct device *dev) static int pxa2xx_spi_suspend(struct device *dev)
{ {
struct driver_data *drv_data = dev_get_drvdata(dev); struct driver_data *drv_data = dev_get_drvdata(dev);
...@@ -1841,9 +1840,7 @@ static int pxa2xx_spi_resume(struct device *dev) ...@@ -1841,9 +1840,7 @@ static int pxa2xx_spi_resume(struct device *dev)
/* Start the queue running */ /* Start the queue running */
return spi_controller_resume(drv_data->controller); return spi_controller_resume(drv_data->controller);
} }
#endif
#ifdef CONFIG_PM
static int pxa2xx_spi_runtime_suspend(struct device *dev) static int pxa2xx_spi_runtime_suspend(struct device *dev)
{ {
struct driver_data *drv_data = dev_get_drvdata(dev); struct driver_data *drv_data = dev_get_drvdata(dev);
...@@ -1858,18 +1855,16 @@ static int pxa2xx_spi_runtime_resume(struct device *dev) ...@@ -1858,18 +1855,16 @@ static int pxa2xx_spi_runtime_resume(struct device *dev)
return clk_prepare_enable(drv_data->ssp->clk); return clk_prepare_enable(drv_data->ssp->clk);
} }
#endif
static const struct dev_pm_ops pxa2xx_spi_pm_ops = { static const struct dev_pm_ops pxa2xx_spi_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(pxa2xx_spi_suspend, pxa2xx_spi_resume) SYSTEM_SLEEP_PM_OPS(pxa2xx_spi_suspend, pxa2xx_spi_resume)
SET_RUNTIME_PM_OPS(pxa2xx_spi_runtime_suspend, RUNTIME_PM_OPS(pxa2xx_spi_runtime_suspend, pxa2xx_spi_runtime_resume, NULL)
pxa2xx_spi_runtime_resume, NULL)
}; };
static struct platform_driver driver = { static struct platform_driver driver = {
.driver = { .driver = {
.name = "pxa2xx-spi", .name = "pxa2xx-spi",
.pm = &pxa2xx_spi_pm_ops, .pm = pm_ptr(&pxa2xx_spi_pm_ops),
.acpi_match_table = ACPI_PTR(pxa2xx_spi_acpi_match), .acpi_match_table = ACPI_PTR(pxa2xx_spi_acpi_match),
.of_match_table = of_match_ptr(pxa2xx_spi_of_match), .of_match_table = of_match_ptr(pxa2xx_spi_of_match),
}, },
......
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