Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8414881ybi; Thu, 6 Jun 2019 11:56:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzG5I5ZSgZoTUxoGERJGbzXyw75gFa9Yko3a7AzvHgKQxWU7/jG2K1WzXeKD5MhaH6p3XQJ X-Received: by 2002:a17:902:9a84:: with SMTP id w4mr52232074plp.241.1559847411034; Thu, 06 Jun 2019 11:56:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559847411; cv=none; d=google.com; s=arc-20160816; b=QPqVQutk8qp/4gDiCNC6pQTI7uhCxV2GeztbBcLt0j5oXFTUGFH2Xv/0kp7gxa8HH9 QUMC/qJ645sQImTHvLYU8VXs5eB+w1f0jHRe68kXMqOidXEzccetkQG13JI13kt8jSlE 36peQe4C/Rrbmge6lkyrL+uSdlda3JXBxWMOr0NlspLiiGK/8J3sGPfZe/IFvX/ft/8u VPC9EjyfyH3omdUVPJKGEG7QBGANmT2lMIHlz1AjWeuG4e0MvkLB0dfwm35m0U4Y6UB2 5BTTQrKWbK8OB9Ya+ul9WhaLeaDzA5B2g9U8uEmKNhOR0zN7CocdRC4qTjva3JENkQBJ iy5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=Vp+M5brGDuC7e6hY9XVD72ejVZQVSg2/8aWViX7BaB0=; b=rEcUExd71WUma68ULHY3a7+9tjzjby7xSB5BMVbEoVavPLsEupwr2lPkD7Dc1EGonZ aRZT/KfrlIxF6yRwCTF6Le7s+jUMM81FQdznJ24yK3TeOLk8S54AeM6dU3eYN257c+1i Qb3ayqP/F9ngnIEEXPZdx2qQfnblINGts6MMfRvMn9oJAPmL8rkuaLKz/1Z8Sh2qBqsR RCVjyt0HmD/cN4H9s7TDAY4Oswu4bssEHMQ8koHXFOe4O71CQ5fim5kduN/DiMLhnGN0 djk/0+1zsr2cqBs2P8w+yrbyEaZNFolJLeV5ZdnOh+u7VugPlOVIVehYtzHH3l0s4Wd3 UF/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MDpTTUSM; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si2656370pgc.116.2019.06.06.11.56.37; Thu, 06 Jun 2019 11:56:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MDpTTUSM; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727307AbfFFR2v (ORCPT + 99 others); Thu, 6 Jun 2019 13:28:51 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:35097 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726762AbfFFR2v (ORCPT ); Thu, 6 Jun 2019 13:28:51 -0400 Received: by mail-qt1-f194.google.com with SMTP id d23so3634651qto.2 for ; Thu, 06 Jun 2019 10:28:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Vp+M5brGDuC7e6hY9XVD72ejVZQVSg2/8aWViX7BaB0=; b=MDpTTUSMMjtu4CbkZAGgdURFobb9ocEUv+tD5QyIZ/UPICVsEV5CtD4TpN7ibBnGyG 07vJgNL5rDZJSrFeU+7JsMKCM4NDRp1uL9pnK7TNB1pQauRUk899CzZjLMZt0q6hXDwe wV7+8imerfLngPXfZ1koxvEgAZVfAzBNwV18ORQ9Ah7SR+PY4lHE944487Uzz+ymAzzz dMiWa5tL8fubC4li7m4h633+7bPnjjwsjoJMktDuMLlJuxPZrYONGqwSZJqX3+wr2zCs bJPd6LUHtKJ2cG8Hizi+zUxfOSUmKzYvOtKBom9myQ3/Pj8yuJrNBwXVBulx3CmyPGCA L10g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Vp+M5brGDuC7e6hY9XVD72ejVZQVSg2/8aWViX7BaB0=; b=fZQLWOosLrbqoBlBGMRc3arDUOFkGTjp58J4dGxsf3RKPmBtebQvQgCSF8XgS4nZ5M hpzYoolGo9u7wc3UKXTLIj/xNb90/dLBsc4PpN8sNA/lgY3hHwBZyEHk07aYzi1RJOTz t60KLkBc/i2SnS1l+2/H2azjmU73LVb6HAytWhyqcNvdznX2o+zGSnxhcXWZvxYLHMAu UG6R7SSk47rkjZ3PcEuMMy+T15lcUMuaFcsgoYm6iW/Wc4/8U5mHGy2O6dO56o/cbcev 4Q20zgS6azIpA8erl/ipsN+LscsPWK50fU3UIR4BP+aa8zcOUJAWjMPyH72cwDQpkU1Y xJGg== X-Gm-Message-State: APjAAAVholeYrrze4RaD5s1OgntG5eyMaP+PyRK9k3p31jiVRG6P6WHG ZgqIKU35zT4hEh22boKI8kg= X-Received: by 2002:a0c:8732:: with SMTP id 47mr19000934qvh.105.1559842130696; Thu, 06 Jun 2019 10:28:50 -0700 (PDT) Received: from fabio-Latitude-E5450.am.freescale.net ([177.221.114.206]) by smtp.gmail.com with ESMTPSA id m5sm1476926qke.25.2019.06.06.10.28.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Jun 2019 10:28:50 -0700 (PDT) From: Fabio Estevam To: herbert@gondor.apana.org.au Cc: christophe.leroy@c-s.fr, linux-crypto@vger.kernel.org, horia.geanta@nxp.com, Fabio Estevam Subject: [PATCH v2] crypto: talitos - Use devm_platform_ioremap_resource() Date: Thu, 6 Jun 2019 14:28:45 -0300 Message-Id: <20190606172845.16864-1-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Use devm_platform_ioremap_resource() to simplify the code a bit. While at it, remove unneeded error message in case of devm_platform_ioremap_resource() failure, as the core mm code will take care of it. Signed-off-by: Fabio Estevam --- Changes since v1: - Adjust the error check for devm_platform_ioremap_resource() - Remove error message on devm_platform_ioremap_resource() failure drivers/crypto/talitos.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 32a7e747dc5f..688affec36c9 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -3336,7 +3336,6 @@ static int talitos_probe(struct platform_device *ofdev) struct talitos_private *priv; int i, err; int stride; - struct resource *res; priv = devm_kzalloc(dev, sizeof(struct talitos_private), GFP_KERNEL); if (!priv) @@ -3350,13 +3349,9 @@ static int talitos_probe(struct platform_device *ofdev) spin_lock_init(&priv->reg_lock); - res = platform_get_resource(ofdev, IORESOURCE_MEM, 0); - if (!res) - return -ENXIO; - priv->reg = devm_ioremap(dev, res->start, resource_size(res)); - if (!priv->reg) { - dev_err(dev, "failed to of_iomap\n"); - err = -ENOMEM; + priv->reg = devm_platform_ioremap_resource(ofdev, 0); + if (IS_ERR(priv->reg)) { + err = PTR_ERR(priv->reg); goto err_out; } -- 2.17.1