| Submitter | John Linn |
|---|---|
| Date | Nov. 12, 2009, 5:17 p.m. |
| Message ID | <38eacaec-f0d3-436c-b461-40b5d795cdd9@VA3EHSMHS009.ehs.local> |
| Download | mbox | patch |
| Permalink | /patch/38260/ |
| State | Superseded |
| Delegated to: | Grant Likely |
| Headers | show |
Comments
On 11/12/09 6:17 PM, John Linn wrote: >> Have you compile tested this? platform_data is a void*, the >> dereference will not work. I know you don't have hardware; but >> getting the needed cross compiler is easy. > > Here's the fixes I did to make it compile. On to testing :) Great! I tested this against a max7301 GPIO expander. --Richard
Patch
diff --git a/drivers/spi/xilinx_spi_of.c b/drivers/spi/xilinx_spi_of.c index 13e1591..2dea9f3 100644 --- a/drivers/spi/xilinx_spi_of.c +++ b/drivers/spi/xilinx_spi_of.c @@ -39,6 +39,7 @@ static int __init xilinx_spi_of_probe(struct of_device *ofdev, const struct of_device_id *match) { + struct xspi_platform_data *pdata = ofdev->dev.platform_data; struct resource r_irq_struct; struct resource r_mem_struct; struct spi_master *master; @@ -74,8 +75,8 @@ static int __init xilinx_spi_of_probe(struct of_device *ofdev, dev_warn(&ofdev->dev, "no 'xlnx,num-ss-bits' property\n"); return -EINVAL; } - ofdev->dev.platform_data->num_chipselect = *prop; - ofdev->dev.platform_data->bits_per_word = 8; + pdata->num_chipselect = *prop; + pdata->bits_per_word = 8; master = xilinx_spi_init(&ofdev->dev, r_mem, r_irq->start, -1); if (!master) return -ENODEV;