On Thu, Feb 03, 2011 at 06:37:46PM +0800, Thomas Chou wrote:

> This patch adds support of OpenCores tiny SPI driver.

A few comments to probe().

> +     /* find and map our resources */
> +     res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +     if (res == NULL) {
> +             dev_err(&pdev->dev, "Cannot get IORESOURCE_MEM\n");
> +             err = -ENOENT;
> +             goto err_no_iores;
> +     }
> +     hw->base = ioremap(res->start, (res->end - res->start) + 1);

No request_mem_region?
Maybe ioremap_nocache?
Please use the resource_size()-macro.

> +err_register:
> +     if (hw->irq >= 0)
> +             free_irq(hw->irq, hw);
> +err_no_irq:
> +     iounmap(hw->base);
> +err_no_iomap:
> +err_no_iores:
> +     spi_master_put(master);
> +err_no_mem:
> +err_no_dev:
> +     return err;

It may pay off to use managed devices (devm_*), so this part will become
very simple.

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Attachment: signature.asc
Description: Digital signature

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

Reply via email to