Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp181137pxa; Wed, 26 Aug 2020 07:55:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyR+BPWsCMYn6Y/8AlGlp5mpJKXTZTwXzy7YndA6spMi2EOoZVMiQeeP5gPFAAfYngWk8n X-Received: by 2002:a05:6402:1205:: with SMTP id c5mr1567730edw.257.1598453729210; Wed, 26 Aug 2020 07:55:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598453729; cv=none; d=google.com; s=arc-20160816; b=oSZ3E4LY/3SlD3wQLCqBHtaAIcCLHOCzORJ227wXojuax5IuQpHSrRv7NrqcRPhnOt 0iq2RIYNflGXb7nidq7IBkfRJUj3Gd0XOzfAywiDvviTmZHDbbzzfi71neHfSkQ1NF/q Ct1v5gcjlbVAH6W1rFNWAxqdiqb2fGI1y5AhNJ0/rmfuJKlKCJVI9mbB4fXpaBFKIROh fXb64/ados12we0FWo+YcpElifLVYVJIvEkOUu3oka70PX2cgmNgqL/gwPLcNsFUCA/a 2jwHuV6MnSQD8ay7uv5fuH04EbnewdtpnLMkNI3fYHedcrhaDODXPhxaR4DFV0N7hE5K MKlg== 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=pt8lxlK/c6bGGtjB6q9OwCZuzqJ/dI6o9S/pPZsfvtU=; b=x95Ff+07wqBqiiMnumwjEA5dItxhytT8wpr1a7gaP9aXwtQ3SYQ+0ialkDnkHxPr0j VbjyfBtFKJSQSUscinTifoG9HM4YaKis0unY6lTejHoqwxsVUtgdiW1wyBN0pa1wGrIY ZjFiQRDHxstwrIvIdYkumZXcJn+6KYBDohCoZWgFT6V8HGO2DzGJtQ1UhVONqzuG5JN3 td5gKKSLXTVWjTd1npM1x1jsIx57FJNTM5NHDlGdKCevgpphEz/iDmQGFdRchknJTxYL 0ysGYhkpKUzjzM0zU+QqmbuHRh6AuM4a8y8HG6VU15MtSzgPZ+sMCSjABl5hUkWRrbfP eYYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TmkqytJ1; 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 gw16si1784148ejb.581.2020.08.26.07.55.06; Wed, 26 Aug 2020 07:55:29 -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=TmkqytJ1; 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 S1727915AbgHZOuF (ORCPT + 99 others); Wed, 26 Aug 2020 10:50:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:34856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727884AbgHZOtq (ORCPT ); Wed, 26 Aug 2020 10:49:46 -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 52E6B22B3F; Wed, 26 Aug 2020 14:49:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453386; bh=Ll4xsfiXa6dFreMGmr8jn0xtDKD1luWEnl5tzrpEESQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TmkqytJ1uLO963Cue4uNLvLBqkcqbxwCNpO+LlZadCR2QQapaEbddrJcUTfClnrue ZbzdsVKMUFNFQTsmFGInc/detcyLH99Z0e9tomw1/7P67wWWT5rz5Q2aE66BP5fbgL i1z4oOIkhjMBYuRov1to802Suxp4iT3qfLbV/m3E= From: Krzysztof Kozlowski To: Charles Keepax , Richard Fitzgerald , Lee Jones , Maxime Coquelin , Alexandre Torgue , alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Cc: Krzysztof Kozlowski Subject: [PATCH 3/3] mfd: wcd934x: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:49:35 +0200 Message-Id: <20200826144935.10067-3-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200826144935.10067-1-krzk@kernel.org> References: <20200826144935.10067-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/mfd/wcd934x.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/wcd934x.c b/drivers/mfd/wcd934x.c index da910302d51a..c274d733b656 100644 --- a/drivers/mfd/wcd934x.c +++ b/drivers/mfd/wcd934x.c @@ -219,12 +219,9 @@ static int wcd934x_slim_probe(struct slim_device *sdev) return -ENOMEM; ddata->irq = of_irq_get(np, 0); - if (ddata->irq < 0) { - if (ddata->irq != -EPROBE_DEFER) - dev_err(ddata->dev, "Failed to get IRQ: err = %d\n", - ddata->irq); - return ddata->irq; - } + if (ddata->irq < 0) + return dev_err_probe(ddata->dev, ddata->irq, + "Failed to get IRQ\n"); reset_gpio = of_get_named_gpio(np, "reset-gpios", 0); if (reset_gpio < 0) { -- 2.17.1