Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp694355pxa; Thu, 27 Aug 2020 13:11:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4RveS42P4u7h+jO2UaWzTqkkK9eEyrNNmgUYyVKjsscQ/sDHDjloqsAZH8+05yAthQ6nh X-Received: by 2002:a17:907:2090:: with SMTP id pv16mr11665612ejb.411.1598559067845; Thu, 27 Aug 2020 13:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598559067; cv=none; d=google.com; s=arc-20160816; b=UgkXkdcITUqQhDQlNLaF43+ezqwWpgJGH4Q4XeG+wZ9e5ok+w0j/3nvbVbyHRsMvDS IVP3qE+M7eh7ewE6UGIhOzhqmhgUcyQbYacWI4YGs4GAYzorrb42b/W6ull1sMkq5eF7 CFYz2SEM1EXbco1ApB7hhK2z32Zu71U4l111t9ohWxl38WtM1BzaQH+6HAcZ/H8d2I4N ekZUHx0dyoNziHOvqP1DTBK8SJECyQNomkIpbAUiK82buP39DeCzjs9nCGuLDREo40Im LzvWVu/CGhmCrouEWqh5YTiZEQV35J3s5xCVYoWexHKDuQhpH5rancSWX530NtpOIEqS lFZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=3KY853gpAdtlzwf01SWuIatMUmSG7haOCBURM/FcWV8=; b=YMKq9fRBscV/PfwVEEYZ7esMSbON3cweLwrNUzKD3OgR0oZjvhPH/CNT7YPqga9Agv GpbxwnHZJTdW9iC2n4UO/5aDky2ZisOLy/KtiQGEmURvfa9QQ6o+MAUl/K+UW33F4jEH cPbZVnrIKPLoFOlaxoxc0Gyn2zrBNPHULNNxm7E3JPhU0x6kBp4hMDuIXf63QhMDAYdU gzY/wfiNrVkh1HH82J7Q/zofGAGmSmW/TpWyVqcLoeYCE/+F8CmH3OqCtOAUNZ39ZzpE P4aZaVXVTK0gpiRgHjxVj/TXkclOEafDbH3y02wl129Nzqz3lCox0WjH2EyFMmvtFP1c YJeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eQxNNqeG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cd8si1896007ejb.421.2020.08.27.13.10.45; Thu, 27 Aug 2020 13:11:07 -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; dkim=pass header.i=@kernel.org header.s=default header.b=eQxNNqeG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727069AbgH0UIo (ORCPT + 99 others); Thu, 27 Aug 2020 16:08:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:55130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbgH0UIk (ORCPT ); Thu, 27 Aug 2020 16:08:40 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 395FE208C9; Thu, 27 Aug 2020 20:08:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558919; bh=7Xgw8IUGP7VLzG8Sb+5jL0H9jR3vAdKv/vfEHwLk754=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eQxNNqeGrTZ87zvEO01q+I627AIhrSDzy8XyPOHUpTNWuvcDNzqfP0Kwkba8wPkDd 8j/Fie4cyZulrsCahbCBiqXdKHf61gmLwM9KYNur0QsqTFHAifFr/eN0YUIQSWUQTe umKg9mWDD/+Xti662qDARD2JVUCJmHyKGUblDEP8= From: Krzysztof Kozlowski To: Ray Jui , Linus Walleij , Bartosz Golaszewski , Florian Fainelli , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Keerthy , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Michal Simek , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Krzysztof Kozlowski Subject: [PATCH 2/6] gpio: davinci: Simplify with dev_err_probe() Date: Thu, 27 Aug 2020 22:08:23 +0200 Message-Id: <20200827200827.26462-2-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827200827.26462-1-krzk@kernel.org> References: <20200827200827.26462-1-krzk@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski --- drivers/gpio/gpio-davinci.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c index 085b874db2a9..6f2138503726 100644 --- a/drivers/gpio/gpio-davinci.c +++ b/drivers/gpio/gpio-davinci.c @@ -237,12 +237,8 @@ static int davinci_gpio_probe(struct platform_device *pdev) for (i = 0; i < nirq; i++) { chips->irqs[i] = platform_get_irq(pdev, i); - if (chips->irqs[i] < 0) { - if (chips->irqs[i] != -EPROBE_DEFER) - dev_info(dev, "IRQ not populated, err = %d\n", - chips->irqs[i]); - return chips->irqs[i]; - } + if (chips->irqs[i] < 0) + return dev_err_probe(dev, chips->irqs[i], "IRQ not populated\n"); } chips->chip.label = dev_name(dev); -- 2.17.1