diff options
author | Linus Walleij <linus.walleij@stericsson.com> | 2010-10-01 05:47:32 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-10-12 23:37:37 -0400 |
commit | 5a1c98be1de165c8ad1bd5343a5d779230669489 (patch) | |
tree | 336a44e0397c55d08daad24f8f3a196d527ac364 /drivers/spi/amba-pl022.c | |
parent | bde435a9ca376d0b7809768ca803dbf14416b9c1 (diff) |
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>
Diffstat (limited to 'drivers/spi/amba-pl022.c')
-rw-r--r-- | drivers/spi/amba-pl022.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c index 59c90f3ccc26..19d54aa31a36 100644 --- a/drivers/spi/amba-pl022.c +++ b/drivers/spi/amba-pl022.c | |||
@@ -1597,58 +1597,58 @@ static int verify_controller_parameters(struct pl022 *pl022, | |||
1597 | { | 1597 | { |
1598 | if ((chip_info->iface < SSP_INTERFACE_MOTOROLA_SPI) | 1598 | if ((chip_info->iface < SSP_INTERFACE_MOTOROLA_SPI) |
1599 | || (chip_info->iface > SSP_INTERFACE_UNIDIRECTIONAL)) { | 1599 | || (chip_info->iface > SSP_INTERFACE_UNIDIRECTIONAL)) { |
1600 | dev_err(chip_info->dev, | 1600 | dev_err(&pl022->adev->dev, |
1601 | "interface is configured incorrectly\n"); | 1601 | "interface is configured incorrectly\n"); |
1602 | return -EINVAL; | 1602 | return -EINVAL; |
1603 | } | 1603 | } |
1604 | if ((chip_info->iface == SSP_INTERFACE_UNIDIRECTIONAL) && | 1604 | if ((chip_info->iface == SSP_INTERFACE_UNIDIRECTIONAL) && |
1605 | (!pl022->vendor->unidir)) { | 1605 | (!pl022->vendor->unidir)) { |
1606 | dev_err(chip_info->dev, | 1606 | dev_err(&pl022->adev->dev, |
1607 | "unidirectional mode not supported in this " | 1607 | "unidirectional mode not supported in this " |
1608 | "hardware version\n"); | 1608 | "hardware version\n"); |
1609 | return -EINVAL; | 1609 | return -EINVAL; |
1610 | } | 1610 | } |
1611 | if ((chip_info->hierarchy != SSP_MASTER) | 1611 | if ((chip_info->hierarchy != SSP_MASTER) |
1612 | && (chip_info->hierarchy != SSP_SLAVE)) { | 1612 | && (chip_info->hierarchy != SSP_SLAVE)) { |
1613 | dev_err(chip_info->dev, | 1613 | dev_err(&pl022->adev->dev, |
1614 | "hierarchy is configured incorrectly\n"); | 1614 | "hierarchy is configured incorrectly\n"); |
1615 | return -EINVAL; | 1615 | return -EINVAL; |
1616 | } | 1616 | } |
1617 | if (((chip_info->clk_freq).cpsdvsr < CPSDVR_MIN) | 1617 | if (((chip_info->clk_freq).cpsdvsr < CPSDVR_MIN) |
1618 | || ((chip_info->clk_freq).cpsdvsr > CPSDVR_MAX)) { | 1618 | || ((chip_info->clk_freq).cpsdvsr > CPSDVR_MAX)) { |
1619 | dev_err(chip_info->dev, | 1619 | dev_err(&pl022->adev->dev, |
1620 | "cpsdvsr is configured incorrectly\n"); | 1620 | "cpsdvsr is configured incorrectly\n"); |
1621 | return -EINVAL; | 1621 | return -EINVAL; |
1622 | } | 1622 | } |
1623 | if ((chip_info->com_mode != INTERRUPT_TRANSFER) | 1623 | if ((chip_info->com_mode != INTERRUPT_TRANSFER) |
1624 | && (chip_info->com_mode != DMA_TRANSFER) | 1624 | && (chip_info->com_mode != DMA_TRANSFER) |
1625 | && (chip_info->com_mode != POLLING_TRANSFER)) { | 1625 | && (chip_info->com_mode != POLLING_TRANSFER)) { |
1626 | dev_err(chip_info->dev, | 1626 | dev_err(&pl022->adev->dev, |
1627 | "Communication mode is configured incorrectly\n"); | 1627 | "Communication mode is configured incorrectly\n"); |
1628 | return -EINVAL; | 1628 | return -EINVAL; |
1629 | } | 1629 | } |
1630 | if ((chip_info->rx_lev_trig < SSP_RX_1_OR_MORE_ELEM) | 1630 | if ((chip_info->rx_lev_trig < SSP_RX_1_OR_MORE_ELEM) |
1631 | || (chip_info->rx_lev_trig > SSP_RX_32_OR_MORE_ELEM)) { | 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 | "RX FIFO Trigger Level is configured incorrectly\n"); | 1633 | "RX FIFO Trigger Level is configured incorrectly\n"); |
1634 | return -EINVAL; | 1634 | return -EINVAL; |
1635 | } | 1635 | } |
1636 | if ((chip_info->tx_lev_trig < SSP_TX_1_OR_MORE_EMPTY_LOC) | 1636 | if ((chip_info->tx_lev_trig < SSP_TX_1_OR_MORE_EMPTY_LOC) |
1637 | || (chip_info->tx_lev_trig > SSP_TX_32_OR_MORE_EMPTY_LOC)) { | 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 | "TX FIFO Trigger Level is configured incorrectly\n"); | 1639 | "TX FIFO Trigger Level is configured incorrectly\n"); |
1640 | return -EINVAL; | 1640 | return -EINVAL; |
1641 | } | 1641 | } |
1642 | if (chip_info->iface == SSP_INTERFACE_NATIONAL_MICROWIRE) { | 1642 | if (chip_info->iface == SSP_INTERFACE_NATIONAL_MICROWIRE) { |
1643 | if ((chip_info->ctrl_len < SSP_BITS_4) | 1643 | if ((chip_info->ctrl_len < SSP_BITS_4) |
1644 | || (chip_info->ctrl_len > SSP_BITS_32)) { | 1644 | || (chip_info->ctrl_len > SSP_BITS_32)) { |
1645 | dev_err(chip_info->dev, | 1645 | dev_err(&pl022->adev->dev, |
1646 | "CTRL LEN is configured incorrectly\n"); | 1646 | "CTRL LEN is configured incorrectly\n"); |
1647 | return -EINVAL; | 1647 | return -EINVAL; |
1648 | } | 1648 | } |
1649 | if ((chip_info->wait_state != SSP_MWIRE_WAIT_ZERO) | 1649 | if ((chip_info->wait_state != SSP_MWIRE_WAIT_ZERO) |
1650 | && (chip_info->wait_state != SSP_MWIRE_WAIT_ONE)) { | 1650 | && (chip_info->wait_state != SSP_MWIRE_WAIT_ONE)) { |
1651 | dev_err(chip_info->dev, | 1651 | dev_err(&pl022->adev->dev, |
1652 | "Wait State is configured incorrectly\n"); | 1652 | "Wait State is configured incorrectly\n"); |
1653 | return -EINVAL; | 1653 | return -EINVAL; |
1654 | } | 1654 | } |
@@ -1658,13 +1658,13 @@ static int verify_controller_parameters(struct pl022 *pl022, | |||
1658 | SSP_MICROWIRE_CHANNEL_FULL_DUPLEX) | 1658 | SSP_MICROWIRE_CHANNEL_FULL_DUPLEX) |
1659 | && (chip_info->duplex != | 1659 | && (chip_info->duplex != |
1660 | SSP_MICROWIRE_CHANNEL_HALF_DUPLEX)) { | 1660 | SSP_MICROWIRE_CHANNEL_HALF_DUPLEX)) { |
1661 | dev_err(chip_info->dev, | 1661 | dev_err(&pl022->adev->dev, |
1662 | "Microwire duplex mode is configured incorrectly\n"); | 1662 | "Microwire duplex mode is configured incorrectly\n"); |
1663 | return -EINVAL; | 1663 | return -EINVAL; |
1664 | } | 1664 | } |
1665 | } else { | 1665 | } else { |
1666 | if (chip_info->duplex != SSP_MICROWIRE_CHANNEL_FULL_DUPLEX) | 1666 | if (chip_info->duplex != SSP_MICROWIRE_CHANNEL_FULL_DUPLEX) |
1667 | dev_err(chip_info->dev, | 1667 | dev_err(&pl022->adev->dev, |
1668 | "Microwire half duplex mode requested," | 1668 | "Microwire half duplex mode requested," |
1669 | " but this is only available in the" | 1669 | " but this is only available in the" |
1670 | " ST version of PL022\n"); | 1670 | " ST version of PL022\n"); |
@@ -1672,7 +1672,7 @@ static int verify_controller_parameters(struct pl022 *pl022, | |||
1672 | } | 1672 | } |
1673 | } | 1673 | } |
1674 | if (chip_info->cs_control == NULL) { | 1674 | if (chip_info->cs_control == NULL) { |
1675 | dev_warn(chip_info->dev, | 1675 | dev_warn(&pl022->adev->dev, |
1676 | "Chip Select Function is NULL for this chip\n"); | 1676 | "Chip Select Function is NULL for this chip\n"); |
1677 | chip_info->cs_control = null_cs_control; | 1677 | chip_info->cs_control = null_cs_control; |
1678 | } | 1678 | } |
@@ -1852,9 +1852,6 @@ static int pl022_setup(struct spi_device *spi) | |||
1852 | "using user supplied controller_data settings\n"); | 1852 | "using user supplied controller_data settings\n"); |
1853 | } | 1853 | } |
1854 | 1854 | ||
1855 | /* Pointer back to the SPI device */ | ||
1856 | chip_info->dev = &spi->dev; | ||
1857 | |||
1858 | /* | 1855 | /* |
1859 | * We can override with custom divisors, else we use the board | 1856 | * We can override with custom divisors, else we use the board |
1860 | * frequency setting | 1857 | * frequency setting |