Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp680318pxa; Thu, 27 Aug 2020 12:47:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuUFIOMpX6HB0WCxRMR9PycMTmUQKxGWGGLSHNuFrzOmRjctEtkV+pynjJMNXxAR13HCrA X-Received: by 2002:a17:906:2717:: with SMTP id z23mr22773116ejc.19.1598557657003; Thu, 27 Aug 2020 12:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598557656; cv=none; d=google.com; s=arc-20160816; b=mm8+C322Ma5U0TILWMB8DIdAV1UlRkdLtE66ZPqS+gssj60GS6L+2Vx7eu6kIJuH3R pnxc9atA5jDwJ17U91Fn7PO6vb6I2h/3bWl4SRfPXgTfNo3jbuuDrr7Hfe2tc1AmE5Do ff/eng8GoITXmKbUq75g18uhMIrL3XnVlve7a+AZv+EhYVJ+NtWvoqUrjfcYxbg6eZTo x3UTz/aveYPTUSc+YQH+dJgYKHoM0iYOLqKNmUnG+GtgGbr0NbG364teHMGaM180CY54 n/cM4C+aBXrJMXbHMrwMUindnSrPShtBdJHJOHR2jiz1N0bAVYcRldKocVf4asvRTdqL 4tjQ== 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=A4NU6BsCwiLu6+Otmj54J8lCct1JA9I1q/fhttNJEeg=; b=H2gMty92Q1ltcRjFNYCrNcqHTSbDoHa5qF1NmoUkCOml/0bnky6P1NIcpWExdqLE5M cMH5oOr8MVR6ONHTX1kIYVHmVB9xErV/wHFi4v9jcJdyCivjaMP/UuVIJ3EcTuvmmmsT 7bTa1c7/Q7RIGjwVeTMw3WnyURqz9K4E9rCK2t/rW9HszLhILHu7SXL7yvshqKeBnGMY BhhSrlTFPRL9d8evpTsbdrZQand2Jfm03GvrPAqPcAqwLYcz32T1fYwU/ZYtjElMn/+Q 5MYO5+8065mkComsaH4FzibCHAqgjkM0L/A+4k3cGViMkVdEbiBnBmRwpl2ei2cjMyft 00Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ihZcH1k7; 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 n8si534386edv.195.2020.08.27.12.47.14; Thu, 27 Aug 2020 12:47:36 -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=ihZcH1k7; 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 S1727894AbgH0Tqe (ORCPT + 99 others); Thu, 27 Aug 2020 15:46:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727838AbgH0Tqc (ORCPT ); Thu, 27 Aug 2020 15:46:32 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2336C061264; Thu, 27 Aug 2020 12:46:31 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id nv17so3185072pjb.3; Thu, 27 Aug 2020 12:46:31 -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=A4NU6BsCwiLu6+Otmj54J8lCct1JA9I1q/fhttNJEeg=; b=ihZcH1k73aBsEgGVPjWLQocZn0fiBEC/RyzxrU/a/t0cYY1yTfKtJ66qVhkBBsp+wF nw779Cfrk1akAVYBNt+EZtWu2J2NmHlfYL/ZlvN6p1PahyRIaAj1EbMUTlhHa7XvgkV0 /8w5ROAiSv76TVIFV+c561WAxlYlzPfMn4sXrzdbRyRtpCjD8TIcgbiJejM6eH3lx27p KK7nlfSrWPxSO4IdnSX613qI7aWFERPo8/MESGlTrwgsb7OrsQOyFAvPaXaIBnfcsQci lWCQhO4na/uVhFLdgKeyFDb+Bf1qSyGck4aHlEjJnvi+8OQUWHxpyr6avAcVkC1Y2CeG RbKw== 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=A4NU6BsCwiLu6+Otmj54J8lCct1JA9I1q/fhttNJEeg=; b=DxDep1SvHbqBdw3BhOrknC8NWv5XTil7rvdD/9AfedU5pmYwQMx6LmCu90jFw79tp0 2ghGPKvbsLeLLHUip00kqBuco7XrOLpsS6QrEHltBTnX/BoTYs3jHnFK6HNcwyqP92oP j+Bxrt9S2rKiNVnIZbXegbYPjT3xeWOzFnmyADGMOkKVw4WCAgHh/mao68r4qYm3fRJ5 MrCxsYgpMVPsbsMubAvmiEmC7QD0/4PR5BAYPh2V+KBgNG6c3I72YjjzXVDtYJihu7p4 churKw18dlXSo1BUF6/HIKCfWfOjcqJZgWUlCOq/zF4ywreU8jNRPHxEhHNPQudOYRiz KIjQ== X-Gm-Message-State: AOAM533MBV35uPDEybVnTYQ9D1gHnpa4tkNDO3r2mp0AKKOGLZR1zE2A pHFoHDgrcJphd6cCpGgQBXHTr1BuCAo5jWpxaYN9FJjvFFpROIRv X-Received: by 2002:a17:90a:2c06:: with SMTP id m6mr392684pjd.129.1598557590941; Thu, 27 Aug 2020 12:46:30 -0700 (PDT) MIME-Version: 1.0 References: <20200827192642.1725-1-krzk@kernel.org> <20200827192642.1725-3-krzk@kernel.org> In-Reply-To: <20200827192642.1725-3-krzk@kernel.org> From: Andy Shevchenko Date: Thu, 27 Aug 2020 22:46:14 +0300 Message-ID: Subject: Re: [PATCH v2 03/18] iio: adc: envelope-detector: 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/envelope-detector.c | 15 +++++---------- > 1 file changed, 5 insertions(+), 10 deletions(-) > > diff --git a/drivers/iio/adc/envelope-detector.c b/drivers/iio/adc/envelope-detector.c > index 2a4fd3bb64cf..91a7be4a3f1b 100644 > --- a/drivers/iio/adc/envelope-detector.c > +++ b/drivers/iio/adc/envelope-detector.c > @@ -348,11 +348,8 @@ static int envelope_detector_probe(struct platform_device *pdev) > indio_dev->num_channels = 1; > > env->dac = devm_iio_channel_get(dev, "dac"); > - if (IS_ERR(env->dac)) { > - if (PTR_ERR(env->dac) != -EPROBE_DEFER) > - dev_err(dev, "failed to get dac input channel\n"); > - return PTR_ERR(env->dac); > - } > + if (IS_ERR(env->dac)) > + return dev_err_probe(dev, PTR_ERR(env->dac), "failed to get dac input channel\n"); > > env->comp_irq = platform_get_irq_byname(pdev, "comp"); > if (env->comp_irq < 0) > @@ -360,11 +357,9 @@ static int envelope_detector_probe(struct platform_device *pdev) > > ret = devm_request_irq(dev, env->comp_irq, envelope_detector_comp_isr, > 0, "envelope-detector", env); > - if (ret) { > - if (ret != -EPROBE_DEFER) > - dev_err(dev, "failed to request interrupt\n"); > - return ret; > - } > + if (ret) > + return dev_err_probe(dev, ret, "failed to request interrupt\n"); > + > env->comp_irq_trigger = irq_get_trigger_type(env->comp_irq); > if (env->comp_irq_trigger & IRQF_TRIGGER_RISING) > env->comp_irq_trigger_inv |= IRQF_TRIGGER_FALLING; > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko