[PATCH] using mii-bitbang on different processor ports

Stephen Rothwell sfr at canb.auug.org.au
Wed Oct 31 13:50:12 EST 2007


On Tue, 30 Oct 2007 17:09:19 +0100 Sergej Stepanov <Sergej.Stepanov at ids.de> wrote:
>
>  static int __devinit fs_mii_bitbang_init(struct mii_bus *bus,
>                                           struct device_node *np)
>  {
> -	struct resource res;
> +	struct resource res[2];

Why not just reuse the same resource structure?  You don't seem to need
them both at the same time.

> +	if( !of_address_to_resource(np, 1, &res[1]))
> +	{
> +		bitbang->mdio.dir = ioremap(res[1].start, res[1].end - res[1].start + 1);
> +		if (!bitbang->mdio.dir)
> +		{
> +			iounmap(bitbang->mdc.dir);
> +			return -ENOMEM;
> +		}
> +		bitbang->mdio.dat = bitbang->mdio.dir + 4;
> +	}
> +	else{

Formatting:
	if () {
	} else {
	}
> +	if ( bitbang->mdio.dir != bitbang->mdc.dir)

No spaces after (, please.  Here and elsewhere.

-- 
Cheers,
Stephen Rothwell                    sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20071031/6fcbac20/attachment.pgp>


More information about the Linuxppc-dev mailing list