lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110203110353.GC6508@pengutronix.de>
Date:	Thu, 3 Feb 2011 12:03:53 +0100
From:	Wolfram Sang <w.sang@...gutronix.de>
To:	Thomas Chou <thomas@...ron.com.tw>
Cc:	David Brownell <dbrownell@...rs.sourceforge.net>,
	Grant Likely <grant.likely@...retlab.ca>,
	nios2-dev@...c.et.ntust.edu.tw,
	devicetree-discuss@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
	spi-devel-general@...ts.sourceforge.net
Subject: Re: [PATCH v4] spi: add OpenCores tiny SPI driver

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/  |

Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ