linux-mips
[Top] [All Lists]

Re: [PATCH 2/4] MIPS: lantiq: adds minimal dcdc driver

To: John Crispin <blogic@openwrt.org>
Subject: Re: [PATCH 2/4] MIPS: lantiq: adds minimal dcdc driver
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Thu, 08 Aug 2013 14:58:28 +0400
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
In-reply-to: <1375952846-25812-2-git-send-email-blogic@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>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1375952846-25812-1-git-send-email-blogic@openwrt.org> <1375952846-25812-2-git-send-email-blogic@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7
Hello.

On 08-08-2013 13:07, John Crispin wrote:

This driver so far only reads the core voltage.

Signed-off-by: John Crispin <blogic@openwrt.org>
[...]

diff --git a/arch/mips/lantiq/xway/dcdc.c b/arch/mips/lantiq/xway/dcdc.c
new file mode 100644
index 0000000..6361c30
--- /dev/null
+++ b/arch/mips/lantiq/xway/dcdc.c
@@ -0,0 +1,75 @@
[...]
+static int dcdc_probe(struct platform_device *pdev)
+{
+       struct resource *res;
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!res) {
+               dev_err(&pdev->dev, "Failed to get resource\n");
+               return -ENOMEM;
+       }

   You do not need to check this with devm_request_and_ioremap() or
devm_ioremap_resource().

+
+       /* remap dcdc register range */
+       dcdc_membase = devm_request_and_ioremap(&pdev->dev, res);

   Use devm_ioremap_resource().

+       if (!dcdc_membase) {
+               dev_err(&pdev->dev, "Failed to remap resource\n");

Error messages are already printed by devm_request_and_ioremap() ordevm_ioremap_resource().

+               return -ENOMEM;

   -EADDRNOTAVAIL is the right code for devm_request_and_ioremap().

WBR, Sergei


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