linux-mips
[Top] [All Lists]

Re: [PATCH 1/5] MIPS: pci-ar724x: convert into a platform driver

To: linux-mips@linux-mips.org
Subject: Re: [PATCH 1/5] MIPS: pci-ar724x: convert into a platform driver
From: John Crispin <john@phrozen.org>
Date: Sat, 02 Feb 2013 15:17:54 +0100
In-reply-to: <1359808846-23083-1-git-send-email-juhosg@openwrt.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1359808846-23083-1-git-send-email-juhosg@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.7) Gecko/20120922 Icedove/10.0.7
On 02/02/13 13:40, Gabor Juhos wrote:
+static int ar724x_pci_probe(struct platform_device *pdev)
+{
+       struct resource *res;
+       int irq;
+
+       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl_base");
+       if (!res)
+               return -EINVAL;
+
+       ar724x_pci_ctrl_base = devm_request_and_ioremap(&pdev->dev, res);
+       if (ar724x_pci_ctrl_base == NULL)
+               return -EBUSY;
+
+       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg_base");
+       if (!res)
+               return -EINVAL;


Hi,

maybe better use platform_get_resource(pdev, IORESOURCE_MEM, 0/1) ... you will otherwise have to patch this again when you convert to OF

        John

<Prev in Thread] Current Thread [Next in Thread>