spi/pl022: get rid of chipinfo dev pointer

What is the dev pointer doing inside the platform data anyway.
We have another pointer to the actual device at hand, use that.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

authored by

Linus Walleij and committed by
Grant Likely
5a1c98be bde435a9

+12 -16
+12 -15
drivers/spi/amba-pl022.c
··· 1597 1597 { 1598 1598 if ((chip_info->iface < SSP_INTERFACE_MOTOROLA_SPI) 1599 1599 || (chip_info->iface > SSP_INTERFACE_UNIDIRECTIONAL)) { 1600 - dev_err(chip_info->dev, 1600 + dev_err(&pl022->adev->dev, 1601 1601 "interface is configured incorrectly\n"); 1602 1602 return -EINVAL; 1603 1603 } 1604 1604 if ((chip_info->iface == SSP_INTERFACE_UNIDIRECTIONAL) && 1605 1605 (!pl022->vendor->unidir)) { 1606 - dev_err(chip_info->dev, 1606 + dev_err(&pl022->adev->dev, 1607 1607 "unidirectional mode not supported in this " 1608 1608 "hardware version\n"); 1609 1609 return -EINVAL; 1610 1610 } 1611 1611 if ((chip_info->hierarchy != SSP_MASTER) 1612 1612 && (chip_info->hierarchy != SSP_SLAVE)) { 1613 - dev_err(chip_info->dev, 1613 + dev_err(&pl022->adev->dev, 1614 1614 "hierarchy is configured incorrectly\n"); 1615 1615 return -EINVAL; 1616 1616 } 1617 1617 if (((chip_info->clk_freq).cpsdvsr < CPSDVR_MIN) 1618 1618 || ((chip_info->clk_freq).cpsdvsr > CPSDVR_MAX)) { 1619 - dev_err(chip_info->dev, 1619 + dev_err(&pl022->adev->dev, 1620 1620 "cpsdvsr is configured incorrectly\n"); 1621 1621 return -EINVAL; 1622 1622 } 1623 1623 if ((chip_info->com_mode != INTERRUPT_TRANSFER) 1624 1624 && (chip_info->com_mode != DMA_TRANSFER) 1625 1625 && (chip_info->com_mode != POLLING_TRANSFER)) { 1626 - dev_err(chip_info->dev, 1626 + dev_err(&pl022->adev->dev, 1627 1627 "Communication mode is configured incorrectly\n"); 1628 1628 return -EINVAL; 1629 1629 } 1630 1630 if ((chip_info->rx_lev_trig < SSP_RX_1_OR_MORE_ELEM) 1631 1631 || (chip_info->rx_lev_trig > SSP_RX_32_OR_MORE_ELEM)) { 1632 - dev_err(chip_info->dev, 1632 + dev_err(&pl022->adev->dev, 1633 1633 "RX FIFO Trigger Level is configured incorrectly\n"); 1634 1634 return -EINVAL; 1635 1635 } 1636 1636 if ((chip_info->tx_lev_trig < SSP_TX_1_OR_MORE_EMPTY_LOC) 1637 1637 || (chip_info->tx_lev_trig > SSP_TX_32_OR_MORE_EMPTY_LOC)) { 1638 - dev_err(chip_info->dev, 1638 + dev_err(&pl022->adev->dev, 1639 1639 "TX FIFO Trigger Level is configured incorrectly\n"); 1640 1640 return -EINVAL; 1641 1641 } 1642 1642 if (chip_info->iface == SSP_INTERFACE_NATIONAL_MICROWIRE) { 1643 1643 if ((chip_info->ctrl_len < SSP_BITS_4) 1644 1644 || (chip_info->ctrl_len > SSP_BITS_32)) { 1645 - dev_err(chip_info->dev, 1645 + dev_err(&pl022->adev->dev, 1646 1646 "CTRL LEN is configured incorrectly\n"); 1647 1647 return -EINVAL; 1648 1648 } 1649 1649 if ((chip_info->wait_state != SSP_MWIRE_WAIT_ZERO) 1650 1650 && (chip_info->wait_state != SSP_MWIRE_WAIT_ONE)) { 1651 - dev_err(chip_info->dev, 1651 + dev_err(&pl022->adev->dev, 1652 1652 "Wait State is configured incorrectly\n"); 1653 1653 return -EINVAL; 1654 1654 } ··· 1658 1658 SSP_MICROWIRE_CHANNEL_FULL_DUPLEX) 1659 1659 && (chip_info->duplex != 1660 1660 SSP_MICROWIRE_CHANNEL_HALF_DUPLEX)) { 1661 - dev_err(chip_info->dev, 1661 + dev_err(&pl022->adev->dev, 1662 1662 "Microwire duplex mode is configured incorrectly\n"); 1663 1663 return -EINVAL; 1664 1664 } 1665 1665 } else { 1666 1666 if (chip_info->duplex != SSP_MICROWIRE_CHANNEL_FULL_DUPLEX) 1667 - dev_err(chip_info->dev, 1667 + dev_err(&pl022->adev->dev, 1668 1668 "Microwire half duplex mode requested," 1669 1669 " but this is only available in the" 1670 1670 " ST version of PL022\n"); ··· 1672 1672 } 1673 1673 } 1674 1674 if (chip_info->cs_control == NULL) { 1675 - dev_warn(chip_info->dev, 1675 + dev_warn(&pl022->adev->dev, 1676 1676 "Chip Select Function is NULL for this chip\n"); 1677 1677 chip_info->cs_control = null_cs_control; 1678 1678 } ··· 1851 1851 dev_dbg(&spi->dev, 1852 1852 "using user supplied controller_data settings\n"); 1853 1853 } 1854 - 1855 - /* Pointer back to the SPI device */ 1856 - chip_info->dev = &spi->dev; 1857 1854 1858 1855 /* 1859 1856 * We can override with custom divisors, else we use the board
-1
include/linux/amba/pl022.h
··· 276 276 * @dma_config: DMA configuration for SSP controller and peripheral 277 277 */ 278 278 struct pl022_config_chip { 279 - struct device *dev; 280 279 enum ssp_interface iface; 281 280 enum ssp_hierarchy hierarchy; 282 281 bool slave_tx_disable;