[PATCH v3 3/9] add Freescale SerDes PHY support

Stephen Rothwell sfr at canb.auug.org.au
Sun Oct 14 15:59:21 EST 2007


On Fri, 12 Oct 2007 21:28:42 +0800 Li Yang <leoli at freescale.com> wrote:
>
> +++ b/arch/powerpc/sysdev/fsl_serdes.c
> +static int __init setup_serdes(struct device_node *np)
> +{
> +	void __iomem *regs;
> +	const void *prot;

Maybe "const char *prot" (it is used as a string).

> +	const unsigned int *freq;
> +	struct resource res;
> +	u32 rfcks;
> +
> +	of_address_to_resource(np, 0, &res);
> +	regs = ioremap(res.start, res.end - res.start + 1);
> +
> +	prot = of_get_property(np, "protocol", NULL);
> +	if (!prot)
> +		return -EINVAL;
> +	freq = of_get_property(np, "clock", NULL);
> +	switch (*freq) {

You should probably check for !freq.  I guess it depends on how much we
trust the device tree.

> +static int __init fsl_serdes_init(void) {
> +	struct device_node *np;
> +
> +	for (np = NULL; (np = of_find_compatible_node(np, NULL, "fsl,serdes")) != NULL;)

	for_each_compatible_node(np, NULL, "fsl,serdes")

-- 
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/20071014/4ea67913/attachment.pgp>


More information about the Linuxppc-dev mailing list