From patchwork Wed Sep 16 08:05:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 7192461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 36836BEEC1 for ; Wed, 16 Sep 2015 08:07:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7527E20615 for ; Wed, 16 Sep 2015 08:07:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 529EB205EF for ; Wed, 16 Sep 2015 08:07:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zc7jH-0000o0-7L; Wed, 16 Sep 2015 08:06:11 +0000 Received: from mail-pa0-f53.google.com ([209.85.220.53]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zc7jE-0000ey-J1 for linux-arm-kernel@lists.infradead.org; Wed, 16 Sep 2015 08:06:09 +0000 Received: by padhy16 with SMTP id hy16so202341637pad.1 for ; Wed, 16 Sep 2015 01:05:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=5vK10KY1Smb7PSCyKQ220vAEcXBZUMzRBvr4ve9LVf8=; b=aipCr5D8VKWqI0JfOfaUUK4YJ/lOOok2wifZfqZXeRQ8+0NH8Gc4JwdS3NcLlZWxS5 6rOfP0UO4tNH4D2LZy/pKaYiVOfSjnrsKltKGpIGwgMAFT7KPX7E5uvZU7e4p+ULvzCV f0/B+Jmio/vxOEuogRnuOPGC1IR/OHBjAXnvL22zKc80fcrU27NQjGyZ3ITVNzIS2Wi1 opnU5d7Uocga44MZfX/v15IHgW2yYSzwAvGpetJcn2qhEEcRDwddu3gF+fux0NG94XSG S8ICRyStBvsEjUmVYa79uX1Zmv29QbRvtOP486PX/YrULP0KC/CCKmSztgtCv9AMw88+ etxA== X-Gm-Message-State: ALoCoQmlfeaXcb+RUlF7ewDi9cpA04qCgteugyhE7MBgLjZgm8rY+RMZBY4b6bZl1A8uyQnIaE8t X-Received: by 10.68.110.132 with SMTP id ia4mr28778074pbb.165.1442390744332; Wed, 16 Sep 2015 01:05:44 -0700 (PDT) Received: from phoenix (36-239-213-31.dynamic-ip.hinet.net. [36.239.213.31]) by smtp.gmail.com with ESMTPSA id ql5sm26306110pac.46.2015.09.16.01.05.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2015 01:05:43 -0700 (PDT) Message-ID: <1442390740.28314.1.camel@ingics.com> Subject: [PATCH] ARM: zx: zx296702-pm-domain.c: Fix check return value of devm_ioremap_resource From: Axel Lin To: Jun Nie Date: Wed, 16 Sep 2015 16:05:40 +0800 X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150916_010608_663836_694CBC67 X-CRM114-Status: GOOD ( 11.73 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Olof Johansson , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP devm_ioremap_resource() returns ERR_PTR on failure. devm_ioremap_resource() will also check res argument and show proper error on error path, so remove the redundant checking for res and error messages. Signed-off-by: Axel Lin Reviewed-by: Jun Nie --- arch/arm/mach-zx/zx296702-pm-domain.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c b/arch/arm/mach-zx/zx296702-pm-domain.c index e08574d..17f778b 100644 --- a/arch/arm/mach-zx/zx296702-pm-domain.c +++ b/arch/arm/mach-zx/zx296702-pm-domain.c @@ -163,16 +163,9 @@ static int zx296702_pd_probe(struct platform_device *pdev) genpd_data->num_domains = ARRAY_SIZE(zx296702_pm_domains); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(&pdev->dev, "no memory resource defined\n"); - return -ENODEV; - } - pcubase = devm_ioremap_resource(&pdev->dev, res); - if (!pcubase) { - dev_err(&pdev->dev, "ioremap fail.\n"); - return -EIO; - } + if (IS_ERR(pcubase)) + return PTR_ERR(pcubase); for (i = 0; i < ARRAY_SIZE(zx296702_pm_domains); ++i) pm_genpd_init(zx296702_pm_domains[i], NULL, false);