Re: [PATCH v2 1/1] dt: Add general DMA window parser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/23/2012 05:53 AM, Hiroshi Doyu wrote:
> From: Hiroshi DOYU <hdoyu@xxxxxxxxxx>
> 
> This code was based on:
> 	"arch/microblaze/kernel/prom_parse.c"
> 	"arch/powerpc/kernel/prom_parse.c"
> 
> "ibm," prefix could be supported with some modification.

That'd probably be a good idea. If it isn't supported, then this code
can't be used as a replacement for the PPC and Microblaze code.

> +int of_parse_dma_window(struct device_node *dn,
> +			const char *propname, int index,
> +			unsigned long *busno,
> +			dma_addr_t *addr, size_t *size)
> +{
> +	const __be32 *dma_window, *end;
> +	int bytes, cur_index = 0;
> +
> +	if (!dn || !propname || !addr || !size)
> +		return -EINVAL;

Instead of erroring out if (!propname), perhaps:

if (!propname)
    propname = "dma-window";

so that only drivers using bindings before this common binding was
defined actually need to write out the property name?

> diff --git a/include/linux/of_address.h b/include/linux/of_address.h
...
> +extern int of_parse_dma_window(struct device_node *dev,
> +			       const char *propname, int index,
> +			       unsigned long *busno,
> +			       dma_addr_t *phys, size_t *size);

This function has the same name as the PPC and Microblaze code it's
based on. Is that going to cause compile and link errors due to
duplicate symbol definitions?
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux