Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp520885ybr; Fri, 22 May 2020 12:10:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+PrXjQR//ZsHzmwywkjraykjfjzVglc1yQduV0Opg7Hu6L4bbpgXqd7TaJMBSifZ1MA8n X-Received: by 2002:a05:6402:948:: with SMTP id h8mr4094553edz.127.1590174610399; Fri, 22 May 2020 12:10:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590174610; cv=none; d=google.com; s=arc-20160816; b=Y9u3Vi97NrJSq2MipqWLnIfQUpz8uPyv5xUXpa6/1eHZWgryEEid/xiUaVBFUw2k6l dWSIoC7Sp1cgKNSLZgQClZ0Js1rtipKu+VwCRjoPhywQBYBL39M20hCHmyrLKcmyvZ7L EkKC9B/nokqabo6Dy/51RcrGgTv56PauMV6lx/SSmshCKoSBzqFDCEPFtHnxt7QB99oe CMaTjnCu+6BGYb4zVVwh2RuBFlPCzSvTYfOE/C/FwEOPXpkFP35RYwgm3y4vPim7ZodA p+/xwxMdGS2xThp081w3jF1xdbh4O+5l4cHPVMhTBSxwJmgGbXag63m4Grqb3ytSYqG1 YiRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=EAactiAKEI7dWX8NnZUQkS4R8/kzCy8Wl82Iyi/j23w=; b=Cx4BDBGNT1lJsglXJuo7OORMmk2m1fH9lo2ek3wyIgxSIU6TM2HUhGGKmyv1zgkl44 PaORiS4pKzCMXuCr+rDpUxRHHtAPStu4AYWBCizv8iD3Ssf5muBmSYR7Y3l5i3dfBHtO Im2FBUiBYXqkPs4N1OrMnrvx4xJWEY04UG7/KJo1gshB5aWaxxoLKWEIVFoNLFlf+UUl YnBuSoqc3D2xFwsFlYF9421pkSDoknLQqhoU8D88DGzk1h1vDksCxdXMeEiY9vk8rHVR 0UFTWwasJvC2lpmirML6pYC7o3quzXM2RkHuLBOo5yFEe8cUMjmtIyJHY5E89ylCJTrF x1bg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si5453491ejx.547.2020.05.22.12.09.47; Fri, 22 May 2020 12:10:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730969AbgEVTHu (ORCPT + 99 others); Fri, 22 May 2020 15:07:50 -0400 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:56664 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730925AbgEVTHu (ORCPT ); Fri, 22 May 2020 15:07:50 -0400 Received: from belgarion ([86.210.245.36]) by mwinf5d03 with ME id hv7i220030nqnCN03v7iXH; Fri, 22 May 2020 21:07:47 +0200 X-ME-Helo: belgarion X-ME-Auth: amFyem1pay5yb2JlcnRAb3JhbmdlLmZy X-ME-Date: Fri, 22 May 2020 21:07:47 +0200 X-ME-IP: 86.210.245.36 From: Robert Jarzmik To: Tiezhu Yang Cc: Linus Walleij , Bartosz Golaszewski , Ray Jui , bcm-kernel-feedback-list@broadcom.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li Subject: Re: [PATCH 2/3] gpio: pxa: Fix return value of pxa_gpio_probe() References: <1590120740-22912-1-git-send-email-yangtiezhu@loongson.cn> <1590120740-22912-2-git-send-email-yangtiezhu@loongson.cn> X-URL: http://belgarath.falguerolles.org/ Date: Fri, 22 May 2020 21:07:23 +0200 In-Reply-To: <1590120740-22912-2-git-send-email-yangtiezhu@loongson.cn> (Tiezhu Yang's message of "Fri, 22 May 2020 12:12:19 +0800") Message-ID: <874ks7okk4.fsf@belgarion.home> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/26 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tiezhu Yang writes: > When call function devm_platform_ioremap_resource(), we should use IS_ERR() > to check the return value and return PTR_ERR() if failed. > > Fixes: 542c25b7a209 ("drivers: gpio: pxa: use devm_platform_ioremap_resource()") > Signed-off-by: Tiezhu Yang > --- > drivers/gpio/gpio-pxa.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c > index 1361270..0cb6600 100644 > --- a/drivers/gpio/gpio-pxa.c > +++ b/drivers/gpio/gpio-pxa.c > @@ -660,8 +660,8 @@ static int pxa_gpio_probe(struct platform_device *pdev) > pchip->irq1 = irq1; > > gpio_reg_base = devm_platform_ioremap_resource(pdev, 0); > - if (!gpio_reg_base) > - return -EINVAL; > + if (IS_ERR(gpio_reg_base)) > + return PTR_ERR(gpio_reg_base); As far as I know, devm_platform_ioremap_resource() could return NULL which is not handled by this test (unless __devm_ioremap() semantics changed since I had a look). Therefore, this patch is incorrect, or rather incomplete. Cheers. -- Robert