[PATCH 4/7] powerpc: BestComm core support for Freescale MPC5200

Stephen Rothwell sfr at canb.auug.org.au
Sun Sep 16 22:31:13 EST 2007


On Sun, 16 Sep 2007 12:53:27 +0200 Sylvain Munaut <tnt at 246tNt.com> wrote:
>
> +++ b/arch/powerpc/sysdev/bestcomm/Makefile
> @@ -0,0 +1,8 @@
> +#
> +# Makefile for BestComm & co
> +#
> +
> +bestcomm-core-objs	:= bestcomm.o sram.o
> +
> +obj-$(CONFIG_PPC_BESTCOMM)		+= bestcomm-core.o

Or just obj-y since the whole makefile is dependent on CONFIG_PPC_BESTCOMM.

> +++ b/arch/powerpc/sysdev/bestcomm/bestcomm.c
>
> +#include <asm/io.h>
> +#include <asm/irq.h>
> +#include <asm/prom.h>
> +#include <asm/mpc52xx.h>
> +#include <asm/of_device.h>
> +#include <asm/of_platform.h>

Please include linux/of_device.h and linux/of_platform.h instead.
And linux/of.h instead of asm/prom.h.

> +	ofn_bcom = op->node;
> +	of_node_get(ofn_bcom);

The usual idiom is ofn_bcom = of_get_node(op->node);

> +	/* Save the node */
> +	bcom_eng->ofnode = ofn_bcom;
> +
> +	/* Get, reserve & map io */
> +	if (of_address_to_resource(bcom_eng->ofnode, 0, &res_bcom)) {
                                   ^^^^^^^^^^^^^^^^
Any reason not to use ofn_bcom here?

> +	/* Error path */
> +error_unmap:
> +	iounmap(bcom_eng->regs);
> +error_release:
> +	release_mem_region(res_bcom.start, sizeof(struct mpc52xx_sdma));
> +error_sramclean:
> +	bcom_sram_cleanup();
> +error_ofput:
> +	of_node_put(bcom_eng->ofnode);
                    ^^^^^^^^^^^^^^^^
And here?  Also bcom_eng doesn't get freed in the error path.

> +++ b/arch/powerpc/sysdev/bestcomm/bestcomm_priv.h
> +#include <linux/spinlock.h>
> +#include <asm/io.h>
> +#include <asm/prom.h>

Again please include linux/of.h instead of asm/prom.h

> +++ b/arch/powerpc/sysdev/bestcomm/sram.c
> +
> +#include <asm/io.h>
> +#include <asm/mmu.h>
> +#include <asm/prom.h>

And again.

-- 
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/20070916/0db0aece/attachment.pgp>


More information about the Linuxppc-dev mailing list