[PATCH v6] qe: add ability to upload QE firmware

Stephen Rothwell sfr at canb.auug.org.au
Tue Jan 8 13:37:47 EST 2008


On Mon,  7 Jan 2008 16:15:44 -0600 Timur Tabi <timur at freescale.com> wrote:
>
> +struct qe_firmware_info *qe_get_firmware_info(void)
> +{

> +	/* Find the 'firmware' child node */
> +	while ((fw = of_get_next_child(qe, fw)))

If you use:
	for_each_child_of_node(qe, fw)
You don't need to initialise 'fw' in its declararion.

> +	/* Did we find the 'firmware' node? */
> +	if (!fw) {
> +		of_node_put(fw);

This of_node_put is not necessary (as fw is NULL);

> +	prop = of_find_property(fw, "extended-modes", NULL);
> +	if (prop && (prop->length == sizeof(u64))) {
> +		const u64 *iprop = prop->value;
> +
> +		qe_firmware_info.extended_modes = *iprop;
> +	}

Why not:
	const u64 *iprop;
	int len;

	iprop = of_get_property(fs, "extended-modes", &len);
	if (iprop && (len == sizeof(u64))
		qe_firmware_info.extended_modes = *iprop;

> +	prop = of_find_property(fw, "virtual-traps", NULL);
> +	if (prop && (prop->length == 32)) {
> +		const u32 *iprop = prop->value;
> +
> +		for (i = 0; i < ARRAY_SIZE(qe_firmware_info.vtraps); i++)
> +			qe_firmware_info.vtraps[i] = iprop[i];
> +	}

And similarly?

-- 
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/20080108/cda3bd4e/attachment.pgp>


More information about the Linuxppc-dev mailing list