Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp579156pxk; Wed, 9 Sep 2020 13:01:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrcIpgJqwgKh2tEUhyEMxvaw4B0hbqZiam3YnyV4XvDK2ovFDSH1EfmAXjrZOE2muPbNsa X-Received: by 2002:a17:907:7215:: with SMTP id dr21mr5740692ejc.68.1599681682397; Wed, 09 Sep 2020 13:01:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599681682; cv=none; d=google.com; s=arc-20160816; b=sdVFeaLphd+Vur6S3xDJfVgeyb52LTh9kUM7NRWlVL2gmV5TvAANjVNztciBQDnZco /BuqzUGKoIQGn8F++iuCv6A/It0RujpkeclTL30oHWVX72oVQhBOxFbeqnm0J4//e3dR A6Z2TgeUQnaVF1l4DyLZKQaPhhxHk4MxUz8fTEGZxNAVfx1u5cjbqGr1vhMQm8G5T4eM 2ehD56byyfCHpptlP0f7yzvsacLmDMWKg/+rfL2owgDwwGal0FW+nVu1e7Jqzf0vIMMs omDn+82zxV4PGEjxXfAK/V6ZRUBqEYpsIjr72m9Bae+1yilwcbnuSL0+gCcVL0BGhfUr kNNA== 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=C88A8BLeqwdkDX3IlA46CbogjlUuePqyhYAOJDvuBuw=; b=F8ElYSO+DC+toE+oTp6rncLRyqdlKdXcMobRjfAwfDv7Lec5/OhziLP0ARlLBMyjy4 nn9l9nFm58h1omDfSvlSFYFQpVdc8Ua+q3ecpz6PS78eSYjGMCGzJ41GD1sz0rFV/xlL nWzUt6Yf5nQRx1Me3ABBjWP7LIfgOExISa4mL1UBPURhe9/zr3Je+cP6+urAw9zUEpvf 7o+Ux71+tGXyYSbzBoO5a31HjrBtk/S1tB2C2Xdz5dSremBKhoM1EDrGJUU92yjw1MiY 4H/PCFLyIeXnA8N0I/NovDwcaUDHq1zwvLRgthZXBTqN0YvsYayf4lE80yvw+i6Znmvy X1UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gH+Ux2bf; 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 ha21si2187274ejb.147.2020.09.09.13.00.58; Wed, 09 Sep 2020 13:01:22 -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=gH+Ux2bf; 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 S1729663AbgIIT55 (ORCPT + 99 others); Wed, 9 Sep 2020 15:57:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:39062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726801AbgIIT55 (ORCPT ); Wed, 9 Sep 2020 15:57:57 -0400 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (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 A2B2521D91; Wed, 9 Sep 2020 19:57:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599681475; bh=Fj/ZQbw6iThGFoHDEPgT4Mpjuadx6d6xm8WtTwb+cS8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gH+Ux2bfsGWe0ZZ8cr/KH4k1RUwrjBxh2rNdIt1VeCmIfHUDCq39wW48JqvtybXWy Rw8pmYp1O3RalPallGy/5d3wY6dSMu5Y/7qWiIPM+cwz8vmVcrJWXqbauDdjEuVqkS bjUUVwZCxI6cw+s+WEaEuQPutenO211vAHrqJv18= Received: by mail-ej1-f53.google.com with SMTP id z22so5325528ejl.7; Wed, 09 Sep 2020 12:57:55 -0700 (PDT) X-Gm-Message-State: AOAM532xczjPP+a2j7QZz9Ei5PMAPunSRjdE6MeKUDi8151A2r3QS+iV bck/u5pz+icuurvMgAUyRnivU4sM7ER9XFwzM2g= X-Received: by 2002:a17:906:8401:: with SMTP id n1mr5150651ejx.215.1599681474195; Wed, 09 Sep 2020 12:57:54 -0700 (PDT) MIME-Version: 1.0 References: <20200829064726.26268-1-krzk@kernel.org> <20200829064726.26268-8-krzk@kernel.org> <20200909193600.41970d8c@archlinux> In-Reply-To: <20200909193600.41970d8c@archlinux> From: Krzysztof Kozlowski Date: Wed, 9 Sep 2020 21:57:41 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 08/18] iio: adc: stm32: Simplify with dev_err_probe() To: Jonathan Cameron Cc: Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Michael Hennerich , Marek Vasut , Tomasz Duszynski , linux-iio@vger.kernel.org, "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, Andy Shevchenko 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 Wed, 9 Sep 2020 at 20:36, Jonathan Cameron wrote: > > On Sat, 29 Aug 2020 08:47:16 +0200 > 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. > > > > Signed-off-by: Krzysztof Kozlowski > > Reviewed-by: Andy Shevchenko > > > I don't have the thread to hand, but this tripped a warning next > and the patch was dropped as a result. See below. Thanks for letting me know. If you mean the warning caused by: https://lore.kernel.org/lkml/20200909073716.GA560912@kroah.com/ then the driver-core patch was dropped, not the iio one: https://lore.kernel.org/linux-next/20200909074130.GB561485@kroah.com/T/#t So we are good here :) Best regards, Krzysztof > Jonathan > > --- > > > > Changes since v2: > > 1. Wrap dev_err_probe() lines at 80 character > > > > Changes since v1: > > 1. Convert to devm_clk_get_optional > > 2. Update also stm32-dfsdm-core and stm32-dac-core. > > 3. Wrap around 100 characters (accepted by checkpatch). > > --- > > drivers/iio/adc/stm32-adc-core.c | 75 ++++++++++-------------------- > > drivers/iio/adc/stm32-adc.c | 10 ++-- > > drivers/iio/adc/stm32-dfsdm-adc.c | 10 ++-- > > drivers/iio/adc/stm32-dfsdm-core.c | 9 ++-- > > drivers/iio/dac/stm32-dac-core.c | 5 +- > > 5 files changed, 35 insertions(+), 74 deletions(-) > > > > diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c > > index 0e2068ec068b..3f27b4817a42 100644 > > --- a/drivers/iio/adc/stm32-adc-core.c > > +++ b/drivers/iio/adc/stm32-adc-core.c > > @@ -582,11 +582,9 @@ static int stm32_adc_core_switches_probe(struct device *dev, > > priv->syscfg = syscon_regmap_lookup_by_phandle(np, "st,syscfg"); > > if (IS_ERR(priv->syscfg)) { > > ret = PTR_ERR(priv->syscfg); > > - if (ret != -ENODEV) { > > - if (ret != -EPROBE_DEFER) > > - dev_err(dev, "Can't probe syscfg: %d\n", ret); > > - return ret; > > - } > > + if (ret != -ENODEV) > > + return dev_err_probe(dev, ret, "Can't probe syscfg\n"); > > + > > priv->syscfg = NULL; > > } > > > > @@ -596,12 +594,9 @@ static int stm32_adc_core_switches_probe(struct device *dev, > > priv->booster = devm_regulator_get_optional(dev, "booster"); > > if (IS_ERR(priv->booster)) { > > ret = PTR_ERR(priv->booster); > > - if (ret != -ENODEV) { > > - if (ret != -EPROBE_DEFER) > > - dev_err(dev, "can't get booster %d\n", > > - ret); > > - return ret; > > - } > > + if (ret != -ENODEV) > > + dev_err_probe(dev, ret, "can't get booster\n"); > > This tripped a warning and got the patch dropped because we no longer > return on error.