Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp179930pxa; Wed, 26 Aug 2020 07:53:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKQNsvV4rag5gIelZphVsOji1SG6ud6chqau65wQBve5SuLmBA973duWTU6ycoCgql4Ziu X-Received: by 2002:a50:ed17:: with SMTP id j23mr10862352eds.158.1598453599255; Wed, 26 Aug 2020 07:53:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598453599; cv=none; d=google.com; s=arc-20160816; b=eNBJPiG7eErRzf80rdy2Yd5X4J300zXXQd0bP2UL7Q8PTCRMvcWyYn4thiN2pB4EXQ jnT3PJO4TdmIFcesvZyEYdeVms/2Oixa5Ah7wbb4CWFuKbhutj+Y2zf05UDLnFtgXtoe ze0rOhsC2Byd8hwH97Nua6LmcAci7FkADeWSonTsBzrH7LnJ/sBWoVU/YHysvP3sTGif JrER538u91k6ZyjiuQyav3lpifdPQgifvSsHI2t8UtIvZ8EwoGz0JKbtmwHvqcHxjpnU kYIWafTz96nrZDuKEoa+O4AZ4PvgHVBDkfjvcDz53oouBF7BvKbx1j5EP/5rD4B7J80x Hhlw== 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=KONQKtU+uzsmz/AU5aFqULJtPyuL/jZzda6nX7PF9jI=; b=Jok7e4GvR9PobRFQlJV+dN1oeAbGOvmwXCipJGONOUobCQoslKbL7xjWQp4A4xiLEp c4z3NIbwk/nyzRNblC1AqjJd75qWJdEsEdRpmyp3ybdszF3RTfgD1kZyY5L8CxDBPqdF 87CtIe4uDaCqQQPlDh7dyvy5TLzsXSSY9lgjrh0qjntDUAUOUUzCkoFhoORS4HgrkVca hGIobN2Xs1ceUo0iCTrRJUH9w90VU1sdSe/qlJGY9OPqkGMBuEvrwowoziGa/4+2tKwj JqpZm38snIUQ+f9dKQzJpRj732QsBSdlXguvEMzQ8WArnPS4NB3JrpQ7BP5fTaWuFF07 hJZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ScUGKkM+; 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 y25si1546980edt.147.2020.08.26.07.52.56; Wed, 26 Aug 2020 07:53:19 -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=ScUGKkM+; 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 S1726875AbgHZOtx (ORCPT + 99 others); Wed, 26 Aug 2020 10:49:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:34572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726809AbgHZOtl (ORCPT ); Wed, 26 Aug 2020 10:49:41 -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 AFABF2177B; Wed, 26 Aug 2020 14:49:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453381; bh=4KSU23WtTjItpkpM4PdbL4vEH8O0UC56ECWXv2J/6J0=; h=From:To:Cc:Subject:Date:From; b=ScUGKkM+UeSzgY8CMhwi8/yLLMbvJ0FnhzjziU28im+JhxuxMHaDVTMN80ixGtMTt Am/zzb5mVpN9sx7OSMnAH1h57ECyeO2+QJbuALgfs9vdz5A8/gdyvvQFmJQih4fqtb DSRsulWA1dpGg5pD7Fvr08H8nTo55Pl9X4WXKrFY= 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 1/3] mfd: madera: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:49:33 +0200 Message-Id: <20200826144935.10067-1-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 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/madera-core.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/mfd/madera-core.c b/drivers/mfd/madera-core.c index 8a8d733fdce5..4ed6ad8ce002 100644 --- a/drivers/mfd/madera-core.c +++ b/drivers/mfd/madera-core.c @@ -369,19 +369,14 @@ EXPORT_SYMBOL_GPL(madera_of_match); static int madera_get_reset_gpio(struct madera *madera) { struct gpio_desc *reset; - int ret; if (madera->pdata.reset) return 0; reset = devm_gpiod_get_optional(madera->dev, "reset", GPIOD_OUT_LOW); - if (IS_ERR(reset)) { - ret = PTR_ERR(reset); - if (ret != -EPROBE_DEFER) - dev_err(madera->dev, "Failed to request /RESET: %d\n", - ret); - return ret; - } + if (IS_ERR(reset)) + return dev_err_probe(madera->dev, PTR_ERR(reset), + "Failed to request /RESET"); /* * A hard reset is needed for full reset of the chip. We allow running -- 2.17.1