[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201403141805.29204.arnd@arndb.de>
Date: Fri, 14 Mar 2014 18:05:28 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Liviu Dudau <Liviu.Dudau@....com>
Cc: "linux-pci" <linux-pci@...r.kernel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Catalin Marinas <Catalin.Marinas@....com>,
Will Deacon <Will.Deacon@....com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
"linaro-kernel" <linaro-kernel@...ts.linaro.org>,
LKML <linux-kernel@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
LAKML <linux-arm-kernel@...ts.infradead.org>,
Tanmay Inamdar <tinamdar@....com>,
Grant Likely <grant.likely@...retlab.ca>
Subject: Re: [PATCH v7 2/6] pci: OF: Fix the conversion of IO ranges into IO resources.
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists