Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1914303pxa; Sat, 29 Aug 2020 07:37:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzne9HSkMu8dpOQvrTsZx9NmaL3vrRtsSWxrk1mnz0SIWgnOmyQfmiCzWPNNCk2NqTrt4+ X-Received: by 2002:a50:ce11:: with SMTP id y17mr3548588edi.86.1598711836914; Sat, 29 Aug 2020 07:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598711836; cv=none; d=google.com; s=arc-20160816; b=abGsGkKHrCubV9MAdwHiYe1p8siw2h0PZbrkwnTn46/3pb0f0gKVqkAc2l1n7VfuF3 sMI9ozoORQLIJzZoX6bknU8DGXaPh2c5X993HACDqkqjNCRy8DJmr6cG/0zOHBvvQMKk LhbJy2uQyUjdn1FCTfc6XADvUfJGAQViVpHdUHsS6AP0mdgCgPZoVlEmlm6bxwscsdUx eejh/ZFR0te+S3Gu6tFt74f0uBIp+WmzVdplx7gMAB8CUlENOxJ0nxq89K0YapfI/HVn zkSS06NcrSOTmfhNKnIQClbPokLVLHG2koDLIEMPPVVL36VhzZlQS1kuSaXdd+YIC/f0 QFlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=xvmF5jtbp96rNK1YNzKTcwlSS0WU5A0DDKXQ8HWxT48=; b=SZcGalHZxnopHT9/Mauyqi1rIrspSk7Klo5XtKL7ZigDn+M/uriJdfIuUCHUvH0eIw o0MTF0lVaUEkNWEwErv/dxd0rV3qT8gJH3QRgGVz8BTYZpASbIJmpvK8KtMjvVqwwIEq udrIA6glEkCgYhgtTfpchFRz14nprL6UUoH9rvXp5fzeeYrmMpQgulDZe10BpNSWTEjE C26VzF8HnZjRDwaPVkJZXCf0SpWFozsaO8bMdncBrDNMWTTEe8UPj86Xj55HvU8BaGF5 nGylzvCs3D5lUAAvXw2+aJu3AaO4cTXJ3OGGFUry8Sa5245BiqZ+2Sp0Ex7TjTFjYDyf S7Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wFpkbrgQ; 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 q25si1646237edb.467.2020.08.29.07.36.53; Sat, 29 Aug 2020 07:37:16 -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=wFpkbrgQ; 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 S1728115AbgH2Oed (ORCPT + 99 others); Sat, 29 Aug 2020 10:34:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:58054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727772AbgH2Oed (ORCPT ); Sat, 29 Aug 2020 10:34:33 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 49EF92065F; Sat, 29 Aug 2020 14:34:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598711672; bh=Bt2LcvmRA8aueOn9MiH2KddIvcJ9ARbLl4fgBrMMH28=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=wFpkbrgQQGSDHhMuRaTI5o3Q0C950XgQuaRIAhBM2rJVMsZnepCaD0CwIu0xjxS6I NkHjakIMpm68h3NjuQT1PFOxzrNnF/Ae4Y/XEfVdcM62EQV1sWjQvLqO3saoLy3LmP /aA2XwUc/M9D+lR7f8pKp0RiwWLhQSTsw4dR++9w= Date: Sat, 29 Aug 2020 15:34:26 +0100 From: Jonathan Cameron To: Krzysztof Kozlowski 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 Subject: Re: [PATCH v3 01/18] iio: accel: bma180: Simplify with dev_err_probe() Message-ID: <20200829153426.5430ad8b@archlinux> In-Reply-To: <20200829064726.26268-1-krzk@kernel.org> References: <20200829064726.26268-1-krzk@kernel.org> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 29 Aug 2020 08:47:09 +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 Series applied to the togreg branch of iio.git. I'll push that out as testing for the autobuilders to play with it sometime later today. Thanks, Jonathan > --- > drivers/iio/accel/bma180.c | 20 ++++++++------------ > 1 file changed, 8 insertions(+), 12 deletions(-) > > diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c > index 5b7a467c7b27..448faed001fd 100644 > --- a/drivers/iio/accel/bma180.c > +++ b/drivers/iio/accel/bma180.c > @@ -1000,19 +1000,15 @@ static int bma180_probe(struct i2c_client *client, > return ret; > > data->vdd_supply = devm_regulator_get(dev, "vdd"); > - if (IS_ERR(data->vdd_supply)) { > - if (PTR_ERR(data->vdd_supply) != -EPROBE_DEFER) > - dev_err(dev, "Failed to get vdd regulator %d\n", > - (int)PTR_ERR(data->vdd_supply)); > - return PTR_ERR(data->vdd_supply); > - } > + if (IS_ERR(data->vdd_supply)) > + return dev_err_probe(dev, PTR_ERR(data->vdd_supply), > + "Failed to get vdd regulator\n"); > + > data->vddio_supply = devm_regulator_get(dev, "vddio"); > - if (IS_ERR(data->vddio_supply)) { > - if (PTR_ERR(data->vddio_supply) != -EPROBE_DEFER) > - dev_err(dev, "Failed to get vddio regulator %d\n", > - (int)PTR_ERR(data->vddio_supply)); > - return PTR_ERR(data->vddio_supply); > - } > + if (IS_ERR(data->vddio_supply)) > + return dev_err_probe(dev, PTR_ERR(data->vddio_supply), > + "Failed to get vddio regulator\n"); > + > /* Typical voltage 2.4V these are min and max */ > ret = regulator_set_voltage(data->vdd_supply, 1620000, 3600000); > if (ret)