[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87mujpky6a.fsf@haabendal.dk>
Date: Tue, 14 May 2019 14:39:25 +0200
From: Esben Haabendal <esben@...bendal.dk>
To: Thomas Bogendoerfer <tbogendoerfer@...e.de>
Cc: Lee Jones <lee.jones@...aro.org>,
Ralf Baechle <ralf@...ux-mips.org>,
Paul Burton <paul.burton@...s.com>,
James Hogan <jhogan@...nel.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jslaby@...e.com>, linux-mips@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-input@...r.kernel.org,
netdev@...r.kernel.org, linux-rtc@...r.kernel.org,
linux-serial@...r.kernel.org
Subject: Re: [PATCH v2 2/4] mfd: ioc3: Add driver for SGI IOC3 chip
On Tue, 09 Apr 2019, Thomas Bogendoerfer wrote:
>
> diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c
> index 358e66b81926..21fe722ebcd8 100644
> --- a/drivers/net/ethernet/sgi/ioc3-eth.c
> +++ b/drivers/net/ethernet/sgi/ioc3-eth.c
>
> [ ... ]
>
> - err = pci_request_regions(pdev, "ioc3");
Why are you dropping the call to pci_request_regions()? Shouldn't you
do something similar in the new mfd driver?
When you are use the the BAR 0 resource as mem_base argument to
mfd_add_devices() later on, it will be split into child resources for
the child devices, but they will not be related to the IORESOURCE_MEM
root tree (iomem_resource) anymore. I don't think that is how it is
supposed to be done, as it will allow random other drivers to request
the exact same memory area.
How/where is the memory resources inserted in the root IORESOURCE_MEM
resource (iomem_resource)? Or is it allowed to use resources without
inserting it into the root tree?
> + SET_NETDEV_DEV(dev, &pdev->dev);
> + ip = netdev_priv(dev);
> + r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + ip->regs = ioremap(r->start, resource_size(r));
> + r = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> + ip->ssram = ioremap(r->start, resource_size(r));
Maybe use devm_platform_ioremap_resource() instead, which handles both
platform_get_resource() and ioremap() in one call..
/Esben
Powered by blists - more mailing lists