[PATCH v2]: NUC900: Add spi driver support for nuc900
Wan ZongShun
mcuos.com at gmail.com
Fri Nov 20 04:49:06 EST 2009
Hi LI jie,
2009/11/20 Li Jie <eltshanli at gmail.com>:
> On Fri, Nov 20, 2009 at 1:26 PM, Wan ZongShun <mcuos.com at gmail.com> wrote:
>> Dear sirs,
>> + err = request_irq(hw->irq, w90p910_spi_irq, 0, pdev->name, hw);
>> + if (err) {
>> + dev_err(&pdev->dev, "Cannot claim IRQ\n");
>> + goto err_irq;
>> + }
>> +
>> + hw->clk = clk_get(&pdev->dev, "spi");
>> + if (IS_ERR(hw->clk)) {
>> + dev_err(&pdev->dev, "No clock for device\n");
>> + err = PTR_ERR(hw->clk);
>> + goto err_clk;
>> + }
>> +
>> + mfp_set_groupg(&pdev->dev);
>> + w90p910_init_spi(hw);
>> +
>> + err = spi_bitbang_start(&hw->bitbang);
>> + if (err) {
>> + dev_err(&pdev->dev, "Failed to register SPI master\n");
>> + goto err_register;
>> + }
>> +
>> + return 0;
>> +
>> +err_register:
>> + clk_disable(hw->clk);
>> + clk_put(hw->clk);
>> +err_clk:
>> + free_irq(hw->irq, hw);
>> +err_irq:
>> + iounmap(hw->regs);
>> +err_iomap:
>> + release_resource(hw->ioarea);
>> + kfree(hw->ioarea);
>
> I think release_mem_region() is better than release_resource() after
> request_mem_region().
> After all, they are a couple :)
>
Thank you,
That sounds not bad. :)
>> +err_pdata:
>> + spi_master_put(hw->master);;
>> +
>> +err_nomem:
>> + return err;
>> +}
>> +
>
--
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
More information about the linux-arm-kernel
mailing list