LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: Thomas Chou <thomas@wytron.com.tw>
Cc: David Brownell <dbrownell@users.sourceforge.net>,
	Grant Likely <grant.likely@secretlab.ca>,
	nios2-dev@sopc.et.ntust.edu.tw,
	devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org,
	spi-devel-general@lists.sourceforge.net
Subject: Re: [PATCH v4] spi: add OpenCores tiny SPI driver
Date: Thu, 3 Feb 2011 12:03:53 +0100	[thread overview]
Message-ID: <20110203110353.GC6508@pengutronix.de> (raw)
In-Reply-To: <1296729466-2936-1-git-send-email-thomas@wytron.com.tw>

[-- Attachment #1: Type: text/plain, Size: 1041 bytes --]

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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2011-02-03 11:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1294645208-6322-1-git-send-email-thomas@wytron.com.tw>
2011-01-12  2:41 ` [PATCH v2] " Thomas Chou
2011-01-17  7:32   ` Thomas Chou
2011-01-20 16:54     ` Grant Likely
2011-01-20 21:36       ` Thomas Chou
2011-01-21 12:27         ` Jonas Bonn
2011-01-24  1:19           ` Thomas Chou
2011-01-24 10:59             ` Jonas Bonn
2011-01-24 14:50               ` Thomas Chou
2011-01-24 15:50                 ` Grant Likely
2011-01-25  3:17               ` [PATCH v3] " Thomas Chou
2011-02-03 10:37                 ` [PATCH v4] " Thomas Chou
2011-02-03 11:03                   ` Wolfram Sang [this message]
2011-02-03 15:20                   ` Dirk Brandewie

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=20110203110353.GC6508@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=dbrownell@users.sourceforge.net \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nios2-dev@sopc.et.ntust.edu.tw \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=thomas@wytron.com.tw \
    --subject='Re: [PATCH v4] spi: add OpenCores tiny SPI driver' \
    /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

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).