linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wan ZongShun <mcuos.com-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Li Jie <eltshanli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-spi
	<spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	David Brownell-sourceforge
	<dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	linux-arm-kernel
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v2]: NUC900: Add spi driver support for nuc900
Date: Fri, 20 Nov 2009 17:49:06 +0800	[thread overview]
Message-ID: <e68bb3470911200149m2f16a529o4701c77d3550abfc@mail.gmail.com> (raw)
In-Reply-To: <8fb2581d0911200018v53bad77aob74d0c33a7c14716-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi LI jie,

2009/11/20 Li Jie <eltshanli@gmail.com>:
> On Fri, Nov 20, 2009 at 1:26 PM, Wan ZongShun <mcuos.com@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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

  parent reply	other threads:[~2009-11-20  9:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20  5:26 [PATCH v2]: NUC900: Add spi driver support for nuc900 Wan ZongShun
2009-11-20  8:18 ` Li Jie
     [not found]   ` <8fb2581d0911200018v53bad77aob74d0c33a7c14716-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-20  9:49     ` Wan ZongShun [this message]
2009-11-21 14:10 ` Li Jie
     [not found]   ` <8fb2581d0911210610j125b5700ydeb25e72efa88eac-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-21 17:38     ` Wan ZongShun
     [not found] ` <4B062887.90803-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-11-26  6:40   ` Wan ZongShun
     [not found]     ` <e68bb3470911252240x7f10dbf1n7e8423340f3a7d25-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-30 22:13       ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e68bb3470911200149m2f16a529o4701c77d3550abfc@mail.gmail.com \
    --to=mcuos.com-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=eltshanli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).