lkml.org 
[lkml]   [2014]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v7 2/6] pci: OF: Fix the conversion of IO ranges into IO resources.
Date
On Friday 14 March 2014, Liviu Dudau wrote:
> +int of_pci_range_to_resource(struct of_pci_range *range,
> + struct device_node *np, struct resource *res)
> +{
> + res->flags = range->flags;
> + if (res->flags & IORESOURCE_IO) {
> + unsigned long port = -1;
> + int err = pci_register_io_range(range->cpu_addr, range->size);
> + if (err)
> + return err;
> + port = pci_address_to_pio(range->cpu_addr);
> + if (port == (unsigned long)-1) {
> + res->start = (resource_size_t)OF_BAD_ADDR;
> + res->end = (resource_size_t)OF_BAD_ADDR;
> + return -EINVAL;
> + }

The error handling is inconsistent here: in one case you set the resource
to OF_BAD_ADDR, in the other one you don't.

Arnd


\
 
 \ /
  Last update: 2014-03-14 19:41    [W:0.997 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site