Hi Marek,

On Sat, Jun 23, 2012 at 3:43 PM, Marek Vasut <ma...@denx.de> wrote:

> +       ssp->clk = clk_get(&pdev->dev, NULL);
> +       if (IS_ERR(ssp->clk)) {
> +               ret = PTR_ERR(ssp->clk);
> +               goto out_spi_free;
> +       }

You could use devm_clk_get here instead,


> +
> +       clk_prepare_enable(ssp->clk);
> +       ssp->clk_rate = clk_get_rate(ssp->clk) / 1000;
> +
> +       stmp_reset_block(ssp->base);
> +
> +       platform_set_drvdata(pdev, host);
> +
> +       ret = spi_register_master(host);
> +       if (ret) {
> +               dev_err(&pdev->dev, "Cannot register SPI master, %d\n", ret);
> +               goto out_clk_put;
> +       }
> +
> +       return 0;
> +
> +out_clk_put:
> +       clk_disable_unprepare(ssp->clk);
> +       clk_put(ssp->clk);

,and then you would not need this clk_put here.

Driver looks good. Thanks for working on it.

Regards,

Fabio Estevam

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to