Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp694674pxa; Thu, 27 Aug 2020 13:11:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyA+ERkZp42Hm8aLPOeVGpnzWN5kDaVIgPdRWUa2jltBn5nDXt0zU5SyBm+NjzR9FYuja0i X-Received: by 2002:a17:906:7c82:: with SMTP id w2mr17757227ejo.87.1598559099965; Thu, 27 Aug 2020 13:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598559099; cv=none; d=google.com; s=arc-20160816; b=pMyQyuoJGe/hTu88eARGLWa1m3JphcAdQ7leIe4nngCmcYYpVUFTp9OtVkYRnOJOeA 0FGdEk/6JWsAH3A6CRg9H3dUaaWPx+npt0iyXxs7q7GkaxpnCjEBMWs0e9oOCVU54+K5 nHalTPKkrtGQ/KFA9NkYlujde1lfF98IcZTofB+t39syoUI4UAnXcrD7H9AEO2ZYK47N k9a2FMA0xOHloRRof7c9rqS9ja3kHIykeHqXb8Xqx/znxN8E4BVw3+nqU12bM1bxUBGg TOIIxxEOfF+iB5PK+IXyVubKvfximPnqPkKbzWBcHWFPgG87XjVdK8octQT8K/9qjpIK ZJlg== 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=bO0uONRMjTmMtGcvYzyfW5MWwdHp9Fm16LQwUwA5lV8=; b=IQ7eFe9FLj4ApbrKBFEzvxkLXfRcYPlu7Oe10KLsTm3K4EMlic2gRBBb/9NWsItfS4 ZqhsWtyS6pv/8YmsGyeyJj6Fol3KFPptXdG4ysY2hWWazxZPmjqdPBiDuGVGVTAgKsjN nSbhwMsQF3GIlykY45k6748cINcNJLlhtARdUb1t0u6sfTDVLv31GvpvY1pNOIO8pLYz /ee3RiqNdRIqlMJ1r3J7gnI+AtKlienWkCKcfUTG2WzkmeS5QN/mINHQnepgpE+wTzkS GmkFEt+4OZ+lDlVGjW3/X3U1a6iSzCrt7+508TbmY5FP36qL/Dffp2op9gwd2UQcSd4Q N6hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V6bLk4Hn; 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 y1si2134900edt.595.2020.08.27.13.11.17; Thu, 27 Aug 2020 13:11:39 -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=V6bLk4Hn; 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 S1727815AbgH0UIt (ORCPT + 99 others); Thu, 27 Aug 2020 16:08:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:55272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727116AbgH0UIs (ORCPT ); Thu, 27 Aug 2020 16:08:48 -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 48205208C9; Thu, 27 Aug 2020 20:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558927; bh=yKbOOPdL7+pZyGE3E1+yfNF4h5jwEHoSCybPJ3uzi8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V6bLk4HnAq9bJHAHUxEWuDmV6GHGctBbrcdHLb+vrQWQGBE03Vl66RbLLdknLICHQ +UMLr5pmALhNjszvyPq5Ch+KLiEGYqrnKzycspwl7K06ZFaairZDo4Z2PnysttwnG0 1Tt5S/Xzw9GLXfesNCRjntPxgNca4AfPReMwD7Eo= 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 4/6] gpio: pca953x: Simplify with dev_err_probe() Date: Thu, 27 Aug 2020 22:08:25 +0200 Message-Id: <20200827200827.26462-4-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-pca953x.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index bd2e96c34f82..b5c3e56613a7 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -1000,12 +1000,9 @@ static int pca953x_probe(struct i2c_client *client, chip->client = client; reg = devm_regulator_get(&client->dev, "vcc"); - if (IS_ERR(reg)) { - ret = PTR_ERR(reg); - if (ret != -EPROBE_DEFER) - dev_err(&client->dev, "reg get err: %d\n", ret); - return ret; - } + if (IS_ERR(reg)) + return dev_err_probe(&client->dev, PTR_ERR(reg), "reg get err\n"); + ret = regulator_enable(reg); if (ret) { dev_err(&client->dev, "reg en err: %d\n", ret); -- 2.17.1