From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Tejun Heo <tj@kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>,
linux-ide@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] ata: ahci_platform: fix devm_ioremap_resource() return value checking
Date: Fri, 14 Mar 2014 18:22:09 +0100 [thread overview]
Message-ID: <2139783.QvectlX5nq@amdc1032> (raw)
devm_ioremap_resource() returns a pointer to the remapped memory or
an ERR_PTR() encoded error code on failure. Fix the check inside
ahci_platform_get_resources() accordingly.
Also while at it remove a needless line break.
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
Compile tested only.
drivers/ata/ahci_platform.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: b/drivers/ata/ahci_platform.c
===================================================================
--- a/drivers/ata/ahci_platform.c 2014-03-14 16:45:04.056724383 +0100
+++ b/drivers/ata/ahci_platform.c 2014-03-14 17:54:12.504653647 +0100
@@ -199,8 +199,7 @@ static void ahci_platform_put_resources(
* RETURNS:
* The allocated ahci_host_priv on success, otherwise an ERR_PTR value
*/
-struct ahci_host_priv *ahci_platform_get_resources(
- struct platform_device *pdev)
+struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct ahci_host_priv *hpriv;
@@ -219,8 +218,9 @@ struct ahci_host_priv *ahci_platform_get
hpriv->mmio = devm_ioremap_resource(dev,
platform_get_resource(pdev, IORESOURCE_MEM, 0));
- if (!hpriv->mmio) {
+ if (IS_ERR(hpriv->mmio)) {
dev_err(dev, "no mmio space\n");
+ rc = PTR_ERR(hpriv->mmio);
goto err_out;
}
WARNING: multiple messages have this Message-ID (diff)
From: b.zolnierkie@samsung.com (Bartlomiej Zolnierkiewicz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ata: ahci_platform: fix devm_ioremap_resource() return value checking
Date: Fri, 14 Mar 2014 18:22:09 +0100 [thread overview]
Message-ID: <2139783.QvectlX5nq@amdc1032> (raw)
devm_ioremap_resource() returns a pointer to the remapped memory or
an ERR_PTR() encoded error code on failure. Fix the check inside
ahci_platform_get_resources() accordingly.
Also while at it remove a needless line break.
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
Compile tested only.
drivers/ata/ahci_platform.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: b/drivers/ata/ahci_platform.c
===================================================================
--- a/drivers/ata/ahci_platform.c 2014-03-14 16:45:04.056724383 +0100
+++ b/drivers/ata/ahci_platform.c 2014-03-14 17:54:12.504653647 +0100
@@ -199,8 +199,7 @@ static void ahci_platform_put_resources(
* RETURNS:
* The allocated ahci_host_priv on success, otherwise an ERR_PTR value
*/
-struct ahci_host_priv *ahci_platform_get_resources(
- struct platform_device *pdev)
+struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct ahci_host_priv *hpriv;
@@ -219,8 +218,9 @@ struct ahci_host_priv *ahci_platform_get
hpriv->mmio = devm_ioremap_resource(dev,
platform_get_resource(pdev, IORESOURCE_MEM, 0));
- if (!hpriv->mmio) {
+ if (IS_ERR(hpriv->mmio)) {
dev_err(dev, "no mmio space\n");
+ rc = PTR_ERR(hpriv->mmio);
goto err_out;
}
next reply other threads:[~2014-03-14 17:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 17:22 Bartlomiej Zolnierkiewicz [this message]
2014-03-14 17:22 ` [PATCH] ata: ahci_platform: fix devm_ioremap_resource() return value checking Bartlomiej Zolnierkiewicz
2014-03-14 18:30 ` Tejun Heo
2014-03-14 18:30 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2139783.QvectlX5nq@amdc1032 \
--to=b.zolnierkie@samsung.com \
--cc=hdegoede@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.