Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp682505pxa; Thu, 27 Aug 2020 12:51:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZBanzL68UXvJ83LxXOn4DkcNoAfz0D1p2QBaCAj7kkbQUindpxUiWJaFfr2XoWnQiHzWi X-Received: by 2002:a17:906:698:: with SMTP id u24mr21848760ejb.57.1598557871505; Thu, 27 Aug 2020 12:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598557871; cv=none; d=google.com; s=arc-20160816; b=wk51XfPDqiH1rEOLCcBqBMj1Ki5ZPF6ok/3ikA7fhLt5puUgo3aPplMvCOg7r8Ryj0 8gdh/luKcbyoWOo+9Oy5QQZMXGKlOLaxQkAlKwdtfXV2sOe4nc0zDBYlWcVSVSrKYk1y mTkKPEz3r2/pLf4weKOkogOeG1rOnnbsz87JjDz5u9ZgwJAeabjqxbKX1O0LXnBaxmSy beb/kyzyiyQYaMa1NtxS/RdFkJd3NvBfyjD7jlrYVQXXasJqIRIHgT7XZRjiBJnuYm/F XmQn0RUiFTx7OXVaoADEXcIG46lMIFcXm4O2F1QJP6rb1/xIgjil+iJjqq0xAe4NGr5/ vMNQ== 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=kacN1ThtNH5U40mcv/4k6dMARnX9bfV0PWOTTEKKot4=; b=Fzhxc8fPN6ND6MgDOpoXIidk2TBkTi4kRAaM567MhLukX3CoWEd/A7qPcc4VwQu2pV 6C9fJokwBBG7Yt18Az84mBDSzT5luO47bGECcIrM1r8eY+a5uhOK/xqDYXWHAbp7SU/Z Yy4zQ1tKHDznf6UPdkLZvrD/OJI605B4xUIRBzC3JeeplTOsS5WxwOHlW9XY2QbP6kij VBJPdJA1hc3UWzA/K3YRsoxBlO0pj6lRKMjokvB6m+4J9RMjGzXx5eZNHSW+/hFxJ7MK opb5PEMh8feqCuGQkmHODQr2hLZ0KPRGQAlz6SbduT4iQNtLm5dpy6qwokssSojczdQ/ Or9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uCHxCyol; 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 t15si2014596ejx.688.2020.08.27.12.50.49; Thu, 27 Aug 2020 12:51:11 -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=uCHxCyol; 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 S1727046AbgH0Ts0 (ORCPT + 99 others); Thu, 27 Aug 2020 15:48:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726243AbgH0TsZ (ORCPT ); Thu, 27 Aug 2020 15:48:25 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99A40C061264; Thu, 27 Aug 2020 12:48:24 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id 67so4087006pgd.12; Thu, 27 Aug 2020 12:48:24 -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=kacN1ThtNH5U40mcv/4k6dMARnX9bfV0PWOTTEKKot4=; b=uCHxCyolCflVbO+WUbO5LZqzBxHhrvlh9Pfc4sUAey8ZLgzdCoqYIrLEdx8BpwQcBh s2GFIussGGUrYPA0MF7HrS5LyrCzsMV7f3icVtHxQDnUdBsayujKjO4yklbNWparyLk6 6s/hYZYO7z9qF50wRRq3vSxKkZRtHXpiiZPUoABcbB8tpDAXLFRK8W47KyZVcZSsbKFl GcpeBcMwA/NHfGzT7yOp5nwKgLoqG3eJzac9x4Zrkxu9rtMnmOVUdbEfRzxdmbXvjGpK VnntcUFcoKeILOSwGYEdjuUalT1APy+Ayiduu0gb6oeP6w5roa17Qj+Rtnan3NJD4kzq Izgg== 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=kacN1ThtNH5U40mcv/4k6dMARnX9bfV0PWOTTEKKot4=; b=PTVrxoC6Aq8WsUFosIuRYITdoY/mGXxZ6HZVHB0QP7dnVgNFDezq7MxOszfhWppgIj O993P1gaNgaLGMZqr1ZgT7CFS0OVd7Z9faQGcwrj15/yZpx3Ch0fh26kCgQpYReuhu9W K84mjp5ZWHlwXEVEdPNZQLG3RRvjheMhrkyAW1mKSoZaILi0aY3VJxAhrHdEXfp0HJYg cTkfHi3A0VIAoRgXAeqRq2rTbli4aqgtCG2LOrhrS1AjLIkyfvmccFlER5Wf/2SI0ayd TQJIfEJu1T6MKq82liG7Q0XYcu+dyqi1I7JWi5q8yYbdPHHH6KBXjy9RsRbapdAzY6BV UWdg== X-Gm-Message-State: AOAM531oMJe4txpYVB0wHcmn1c8fI3Nf5zJud90sNgx1nlGTl2bgLfgw /PHHDNfizqlOXf8nGlo+z8/v3/U2bVnygH7gBko= X-Received: by 2002:a17:902:407:: with SMTP id 7mr17541240ple.167.1598557703780; Thu, 27 Aug 2020 12:48:23 -0700 (PDT) MIME-Version: 1.0 References: <20200827192642.1725-1-krzk@kernel.org> <20200827192642.1725-5-krzk@kernel.org> In-Reply-To: <20200827192642.1725-5-krzk@kernel.org> From: Andy Shevchenko Date: Thu, 27 Aug 2020 22:48:07 +0300 Message-ID: Subject: Re: [PATCH v2 05/18] iio: adc: ltc2497: 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:27 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 > > --- > > Changes since v1: > 1. Wrap dev_err_probe() lines at 100 character > --- > drivers/iio/adc/ltc2497-core.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/iio/adc/ltc2497-core.c b/drivers/iio/adc/ltc2497-core.c > index 9b8fd9c32364..d337ed96bbb0 100644 > --- a/drivers/iio/adc/ltc2497-core.c > +++ b/drivers/iio/adc/ltc2497-core.c > @@ -180,13 +180,8 @@ int ltc2497core_probe(struct device *dev, struct iio_dev *indio_dev) > return ret; > > ddata->ref = devm_regulator_get(dev, "vref"); > - if (IS_ERR(ddata->ref)) { > - if (PTR_ERR(ddata->ref) != -EPROBE_DEFER) > - dev_err(dev, "Failed to get vref regulator: %pe\n", > - ddata->ref); > - > - return PTR_ERR(ddata->ref); > - } > + if (IS_ERR(ddata->ref)) > + return dev_err_probe(dev, PTR_ERR(ddata->ref), "Failed to get vref regulator\n"); > > ret = regulator_enable(ddata->ref); > if (ret < 0) { > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko