|
@@ -346,8 +346,6 @@ static int orion_spi_probe(struct platform_device *pdev)
|
|
struct resource *r;
|
|
struct resource *r;
|
|
unsigned long tclk_hz;
|
|
unsigned long tclk_hz;
|
|
int status = 0;
|
|
int status = 0;
|
|
- const u32 *iprop;
|
|
|
|
- int size;
|
|
|
|
|
|
|
|
master = spi_alloc_master(&pdev->dev, sizeof(*spi));
|
|
master = spi_alloc_master(&pdev->dev, sizeof(*spi));
|
|
if (master == NULL) {
|
|
if (master == NULL) {
|
|
@@ -358,10 +356,10 @@ static int orion_spi_probe(struct platform_device *pdev)
|
|
if (pdev->id != -1)
|
|
if (pdev->id != -1)
|
|
master->bus_num = pdev->id;
|
|
master->bus_num = pdev->id;
|
|
if (pdev->dev.of_node) {
|
|
if (pdev->dev.of_node) {
|
|
- iprop = of_get_property(pdev->dev.of_node, "cell-index",
|
|
|
|
- &size);
|
|
|
|
- if (iprop && size == sizeof(*iprop))
|
|
|
|
- master->bus_num = *iprop;
|
|
|
|
|
|
+ u32 cell_index;
|
|
|
|
+ if (!of_property_read_u32(pdev->dev.of_node, "cell-index",
|
|
|
|
+ &cell_index))
|
|
|
|
+ master->bus_num = cell_index;
|
|
}
|
|
}
|
|
|
|
|
|
/* we support only mode 0, and no options */
|
|
/* we support only mode 0, and no options */
|