Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp183331pxa; Wed, 26 Aug 2020 07:58:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgipEcPooBUZAOYG1nrx10ECqUvBeCsIWKuGrQE+gajISMwHFuZJkTFWCq/hLiT2LePNE5 X-Received: by 2002:a05:6402:782:: with SMTP id d2mr15737397edy.186.1598453934944; Wed, 26 Aug 2020 07:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598453934; cv=none; d=google.com; s=arc-20160816; b=dJHuvnF5C3P4IU27xGjidTcZpsNMkbcRavYt73kurHKu5gGaSONq7epHgWNB8UpKso b0bER7Gr8XPDjZ6Z+8SbZCwDWqAF3NFaBUzr0nCIxX0HgAHWMYU5bIe9UVNxtfVl0NUq SFohTLUll/k1OQ3fWt9rANXQm8bH/2MmG99RNX321pc47HfJbS7J8M971z/+6UnWSkEL Fqx/Iz+CIOVmSnUwOiUzsjavGdeiAujbnT9mFDxrw6IaY31H7PCVy2psS2vMCd2JEtWx VeTExK65ZurTS1Ay/IPTP2VIZUHlljlRGQmqC37VV7D6rBNrm4ywb8btjw90Ucd+mhWe L9NQ== 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:to:from:dkim-signature; bh=nUzIGOUfzrXhG7g7sdNfwB7N79exhf+xtZYe0SuayEY=; b=f/I9EJQIGPOMpf5BBzzV3z9aD0o/gwHhi5/EUCmOaecaffYiqO86o2JlKqLHChefeg 7tEeqxmv0AULbQDWoc3UchaEWJO++gJkYw26Rj+ugTU51rL8HrL2Ozi2Cr8enWvbngBe cS9tZ+4Y92RkEeV+mRQz6ogpTtsr64LEn7FYIQmSjw8VhROaV3v+GulygGw8cdcsdNT2 PAs3xPxn4R/2gUysZ7lcdnGHR5Ri/Vrw2VLRh4lEdK8gGcyuDxLIIUzaOaeGNQQnvg2L Qe3/OAUS4fB9orrn68FQOmtWj69gzlNGIwR0QEKNqRzUpmY8EB0IURCkTQBy0x83y48O JvRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="vP/Bl97+"; 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 d4si1560385edz.16.2020.08.26.07.58.32; Wed, 26 Aug 2020 07:58:54 -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="vP/Bl97+"; 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 S1728473AbgHZO46 (ORCPT + 99 others); Wed, 26 Aug 2020 10:56:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:40618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726809AbgHZOxX (ORCPT ); Wed, 26 Aug 2020 10:53:23 -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 3DB7921741; Wed, 26 Aug 2020 14:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453602; bh=L62NHGTlHRmxfW0UXMzF8rz6Eg4TzDjh28d5OkWRb1E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vP/Bl97+JtTx4OaxuqQf637JfAncWM+cvwXtDyt0M8X8AQGOnemx5q4V2euAPCZtf WMttIrtvRRJoKWifKDkfX1+8Lk9eoqJepIe0UPQtCofwtHrOo0FSV5Ulu90tABrKky CgwWyQQVxz02bZRXieUrcDYksXCsOiCqHlrCVigs= From: Krzysztof Kozlowski To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Kukjin Kim , Krzysztof Kozlowski , Michael Hennerich , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Marek Vasut , Maxime Coquelin , Alexandre Torgue , Beniamin Bia , Tomasz Duszynski , Linus Walleij , Jonathan Bakker , Alexandru Ardelean , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 14/16] iio: light: isl29018: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:51:51 +0200 Message-Id: <20200826145153.10444-14-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200826145153.10444-1-krzk@kernel.org> References: <20200826145153.10444-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/iio/light/isl29018.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c index ac8ad0f32689..2689867467a8 100644 --- a/drivers/iio/light/isl29018.c +++ b/drivers/iio/light/isl29018.c @@ -746,12 +746,9 @@ static int isl29018_probe(struct i2c_client *client, chip->suspended = false; chip->vcc_reg = devm_regulator_get(&client->dev, "vcc"); - if (IS_ERR(chip->vcc_reg)) { - err = PTR_ERR(chip->vcc_reg); - if (err != -EPROBE_DEFER) - dev_err(&client->dev, "failed to get VCC regulator!\n"); - return err; - } + if (IS_ERR(chip->vcc_reg)) + return dev_err_probe(&client->dev, PTR_ERR(chip->vcc_reg), + "failed to get VCC regulator!\n"); err = regulator_enable(chip->vcc_reg); if (err) { -- 2.17.1