提交 5434b203 编写于 作者: B Bartlomiej Zolnierkiewicz 提交者: Tejun Heo

ata: ahci_platform: fix devm_ioremap_resource() return value checking

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: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: NTejun Heo <tj@kernel.org>
上级 13e8e78b
...@@ -199,8 +199,7 @@ static void ahci_platform_put_resources(struct device *dev, void *res) ...@@ -199,8 +199,7 @@ static void ahci_platform_put_resources(struct device *dev, void *res)
* RETURNS: * RETURNS:
* The allocated ahci_host_priv on success, otherwise an ERR_PTR value * The allocated ahci_host_priv on success, otherwise an ERR_PTR value
*/ */
struct ahci_host_priv *ahci_platform_get_resources( struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev)
struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct ahci_host_priv *hpriv; struct ahci_host_priv *hpriv;
...@@ -219,8 +218,9 @@ struct ahci_host_priv *ahci_platform_get_resources( ...@@ -219,8 +218,9 @@ struct ahci_host_priv *ahci_platform_get_resources(
hpriv->mmio = devm_ioremap_resource(dev, hpriv->mmio = devm_ioremap_resource(dev,
platform_get_resource(pdev, IORESOURCE_MEM, 0)); platform_get_resource(pdev, IORESOURCE_MEM, 0));
if (!hpriv->mmio) { if (IS_ERR(hpriv->mmio)) {
dev_err(dev, "no mmio space\n"); dev_err(dev, "no mmio space\n");
rc = PTR_ERR(hpriv->mmio);
goto err_out; goto err_out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册