mirror of https://gitee.com/openkylin/linux.git
spi: pxa2xx: Introduce temporary variables to increase readability
The current conditional for PCI ID matching is hard to read. Introduce couple of temporary variables to increase readability of the code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20191021103625.4250-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
e58f7d15e6
commit
6fb7427d84
|
@ -1516,13 +1516,14 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
|
||||||
struct pxa2xx_spi_controller *pdata;
|
struct pxa2xx_spi_controller *pdata;
|
||||||
struct ssp_device *ssp;
|
struct ssp_device *ssp;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
struct device *parent = pdev->dev.parent;
|
||||||
|
struct pci_dev *pcidev = dev_is_pci(parent) ? to_pci_dev(parent) : NULL;
|
||||||
const struct pci_device_id *pcidev_id = NULL;
|
const struct pci_device_id *pcidev_id = NULL;
|
||||||
enum pxa_ssp_type type;
|
enum pxa_ssp_type type;
|
||||||
const void *match;
|
const void *match;
|
||||||
|
|
||||||
if (dev_is_pci(pdev->dev.parent))
|
if (pcidev)
|
||||||
pcidev_id = pci_match_id(pxa2xx_spi_pci_compound_match,
|
pcidev_id = pci_match_id(pxa2xx_spi_pci_compound_match, pcidev);
|
||||||
to_pci_dev(pdev->dev.parent));
|
|
||||||
|
|
||||||
match = device_get_match_data(&pdev->dev);
|
match = device_get_match_data(&pdev->dev);
|
||||||
if (match)
|
if (match)
|
||||||
|
@ -1549,8 +1550,8 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
|
||||||
|
|
||||||
#ifdef CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
if (pcidev_id) {
|
if (pcidev_id) {
|
||||||
pdata->tx_param = pdev->dev.parent;
|
pdata->tx_param = parent;
|
||||||
pdata->rx_param = pdev->dev.parent;
|
pdata->rx_param = parent;
|
||||||
pdata->dma_filter = pxa2xx_spi_idma_filter;
|
pdata->dma_filter = pxa2xx_spi_idma_filter;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue