Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp686606pxa; Thu, 27 Aug 2020 12:58:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNHkxrnnVNFW2PivwMGCa4UYLLiae6kw5yCR48CKEk29vvq2tdH6X9rVaoqomK6gjz4gSX X-Received: by 2002:a17:906:130a:: with SMTP id w10mr7830330ejb.106.1598558325796; Thu, 27 Aug 2020 12:58:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598558325; cv=none; d=google.com; s=arc-20160816; b=AYAyFGJfUEX3C0E1qlwYDbdG6bBeFg4I/hh4SAp0rKI+++4+NqdMlFuQdlk4OPltil oz16NMeelHgmzqejSPrRVbugy0RAZzz37KZTUDtVKMk2LPqgcBSnUlfNLdA38v8YWcE7 Vm9uOKwowF2CvizQ+SvunpQlVqoVHSc7koRCevER3iJGPqVJIVXsmaCCzCVmOI0gC73a sdgeIIJYMGnZVeHkg4tX80VVGLXuZQIpjG0hnFnGM7dddXLE/lBs2y9Z845/e82FXELr AudpsXWcYvZzB0ig97jbn+62ygXNnT18sGr8LDXYAqUtJiz91QauB6IfEswP39gc82p3 O2Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zKJLemoVLYYxLBYCuDxkTU6hysuqtvkOfMWKltUpHmg=; b=D3cqVSGpeRkfF46fu/WNaH8ce2xTdxHuYQbnYaIbMxuh6crKH7jbLx31RkX4TVl4bD cANmB0tw+4rrKvJyDvHAXqh26pekfaEK812mKd/ON3imB850Kko/mxpW/QyCvSNfzAcQ jdbLIz7uxk7Ru14DBkdH44g1fwInSJ/e4WOOW8VrCqCpgUZ9TfaMhCCuhOpCOluPQxqd RdWwimg7KF6Hs81XDEDeRJo6mP/MKU8O1kIftJqxW5l/Opj1XraT0djSgHDxeeowXtBC jfWo1jlGN7lr8EHicErwGNNAgkRO4Efpe7grMWK5mAVDBKGR+eK0zlOdoGhigNB5QKt6 qChA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aHv8XBuv; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l14si2291621edv.544.2020.08.27.12.58.22; Thu, 27 Aug 2020 12:58:45 -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=@gmail.com header.s=20161025 header.b=aHv8XBuv; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727991AbgH0Tzn (ORCPT + 99 others); Thu, 27 Aug 2020 15:55:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727863AbgH0Tzm (ORCPT ); Thu, 27 Aug 2020 15:55:42 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40C42C06121B; Thu, 27 Aug 2020 12:55:42 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id q93so3097853pjq.0; Thu, 27 Aug 2020 12:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zKJLemoVLYYxLBYCuDxkTU6hysuqtvkOfMWKltUpHmg=; b=aHv8XBuvf3mu31R7gKeKtuhgl1EoOsKrQs5CzuB4CzH9W+US75wwPQkCadexNhNh8Y 0aNGjmQg3w5t6xy7olIU3pLgnxAKjeBpK4hvGZeHopw6+XaKY3sCmgG8BERcRAN5hbty o90oICnyLq0PNZgSAc9Vx68ynwtaBo929qt8T5KVuCBUcgZ8iN8NKp4zsjEHhXsubYNi i20SB1o6xkpoYW5/YSmIBPyAI7ziv/N6WHGyTfxG80rFCPalXkVksf0FNDPmLSK41pL4 NumTs+7qpXLhoWktPnOAmSOHDxt0X0RQs0eC41ysk8HCQtMo5qeBU9DzR1qJh77FoN7c QTYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zKJLemoVLYYxLBYCuDxkTU6hysuqtvkOfMWKltUpHmg=; b=jojwB8mHym9ZXe13eieDdfgsIhXHSa3vRbk9MaAiYG2mWPSFKMQEhYSm4Ntd1+KSY/ DkExgHG2cq5R5SV+MeRTuICE9wVe4/1gcL8VIClVgt6gXobvNqC6k6UjIrSomydMC2Ng bxOJvYw0MX2t/BRK+vCmm390tikNPIOhXa/YlZzjcQyrIQyLZ34l+WQy7YWHUuLCAU4E 5DCJ8N4reaPf90u877FF7zV8Q0H6ljVJ1a51Kqq91EO89PlEFE8yss2PXCIPCpvHY9pX Wx9YhFfxMBEF5jZeZ6ClpKZkzBsLJBwzQM94CqMHp66muOF2Vw7+huIJ/JP1xDpul5l7 R5fg== X-Gm-Message-State: AOAM530Ns0hsewABPS6Jvc5xrWdOdBvMizi0bHi3Cn37M/tNtqjBsCY6 YI7N2MlhX9hfdD3fHgEJg8drFX13YZhJ8ukNOfk= X-Received: by 2002:a17:90a:e7cb:: with SMTP id kb11mr384454pjb.181.1598558141774; Thu, 27 Aug 2020 12:55:41 -0700 (PDT) MIME-Version: 1.0 References: <20200827192642.1725-1-krzk@kernel.org> <20200827192642.1725-11-krzk@kernel.org> In-Reply-To: <20200827192642.1725-11-krzk@kernel.org> From: Andy Shevchenko Date: Thu, 27 Aug 2020 22:55:25 +0300 Message-ID: Subject: Re: [PATCH v2 11/18] iio: chemical: scd30: Simplify with dev_err_probe() To: Krzysztof Kozlowski Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Kukjin Kim , Michael Hennerich , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Marek Vasut , Maxime Coquelin , Alexandre Torgue , Beniamin Bia , Tomasz Duszynski , Linus Walleij , linux-iio , Linux Kernel Mailing List , linux-arm Mailing List , linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 27, 2020 at 10:28 PM Krzysztof Kozlowski wrote: > > Common pattern of handling deferred probe can be simplified with > dev_err_probe(). Less code and also it prints the error value. Reviewed-by: Andy Shevchenko > Signed-off-by: Krzysztof Kozlowski > Acked-by: Tomasz Duszynski > > --- > > Changes since v1: > 1. Wrap dev_err_probe() lines at 100 character > 2. Add Ack > --- > drivers/iio/chemical/scd30_core.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/iio/chemical/scd30_core.c b/drivers/iio/chemical/scd30_core.c > index eac76972f83e..4d0d798c7cd3 100644 > --- a/drivers/iio/chemical/scd30_core.c > +++ b/drivers/iio/chemical/scd30_core.c > @@ -705,13 +705,8 @@ int scd30_probe(struct device *dev, int irq, const char *name, void *priv, > indio_dev->available_scan_masks = scd30_scan_masks; > > state->vdd = devm_regulator_get(dev, "vdd"); > - if (IS_ERR(state->vdd)) { > - if (PTR_ERR(state->vdd) == -EPROBE_DEFER) > - return -EPROBE_DEFER; > - > - dev_err(dev, "failed to get regulator\n"); > - return PTR_ERR(state->vdd); > - } > + if (IS_ERR(state->vdd)) > + return dev_err_probe(dev, PTR_ERR(state->vdd), "failed to get regulator\n"); > > ret = regulator_enable(state->vdd); > if (ret) > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko