qspi = spi_master_get_devdata(master);
qspi->master = master;
qspi->dev = &pdev->dev;
- r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++++++++++ platform_set_drvdata(pdev, qspi);
+ ++++++++
- -------- r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ ++++++++ r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qspi_base");
++ ++++++++ if (r == NULL) {
++ ++++++++ r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ ++++++++ if (r == NULL) {
++ ++++++++ dev_err(&pdev->dev, "missing platform data\n");
++ ++++++++ return -ENODEV;
++ ++++++++ }
++ ++++++++ }
+
++ ++++++++ res_mmap = platform_get_resource_byname(pdev,
++ ++++++++ IORESOURCE_MEM, "qspi_mmap");
++ ++++++++ if (res_mmap == NULL) {
++ ++++++++ res_mmap = platform_get_resource(pdev, IORESOURCE_MEM, 1);
++ ++++++++ if (res_mmap == NULL) {
++ ++++++++ dev_err(&pdev->dev,
++ ++++++++ "memory mapped resource not required\n");
++ ++++++++ return -ENODEV;
++ ++++++++ }
++ ++++++++ }
++ ++++++++
++ ++++++++ res_ctrl = platform_get_resource_byname(pdev,
++ ++++++++ IORESOURCE_MEM, "qspi_ctrlmod");
++ ++++++++ if (res_ctrl == NULL) {
++ ++++++++ res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 2);
++ ++++++++ if (res_ctrl == NULL) {
++ ++++++++ dev_dbg(&pdev->dev,
++ ++++++++ "control module resources not required\n");
++ ++++++++ }
++ ++++++++ }
irq = platform_get_irq(pdev, 0);
if (irq < 0) {