Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp917710pxb; Wed, 29 Sep 2021 12:28:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWY+Vwqg1CUhUAZDhKLygt3AtCvPcPYBX08tGBNbiZp4nMxMcgyUrznLyBkZ/oysoToaWr X-Received: by 2002:a50:cf4e:: with SMTP id d14mr1996448edk.292.1632943694224; Wed, 29 Sep 2021 12:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632943694; cv=none; d=google.com; s=arc-20160816; b=wneSNqaHWlHhV5x9bk6M60zfw6dwA729SsgdsqtwnYzEvGda6pZcauAfiYZyL9TW/a sJVE+CE7j2F5CC6++Kxop4F+zkU3qsKKo6XrsAfY4WtaY7wxWwbx1m7oEHD6+BlRVIhp fQCn4cbld7baJF/5v/Taj8ti4B2Qsrr/nbZbfY46y960vkAf8s7tzEKp05AFF6LYCNLi lW3kGbgVMXHlQwVbNc8Q8RKs62ZMXhqw/Rn+FxrB40Tx3nA5UliBemyNo6bPqN3Ac9bv ptBf4N5qsz4akmz+tFs2lPaFAzWRp/hzyBACu5XSbubjYoQogPlAQ6LVS+wUtjT1sBbD 368A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=D2PEY2jmSIc5z2KWdQhPZjgZeZnOLfBq8K7k8rr0PP0=; b=gJbyK4JgtOXjze51jUi3Sr9HZKBqcV2F14gLwI6xPj8YtK8MZmfhGVNtgegFWionPQ Sn6PdUGiRDVGG6mU2yJ/PnV1bLkpadW/ki9jabAubgr9DsVSL9Q/pGxNYdW/1YmlcSTw R85pJYI65EwoKvGiGimkS7EM7897lZ7Hw/G5rO5yM6pJj8wIGIQSoEoGsquwLbV4JCRw d5JYmrMbHYGFoTaHIbvRBPANVhB7ZAihmCxHaxqg5fgHNPiN95nxWL/fexbITarDEJx/ dvwvxBIwkm+kGZS55jRUYG0Io5FxtYE8znyKcG/ZbIozoDFHNzQ7AZ5/jHXs6Kqf8opu fd7g== ARC-Authentication-Results: i=1; mx.google.com; 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 bq25si928910edb.79.2021.09.29.12.27.48; Wed, 29 Sep 2021 12:28:14 -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; 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 S1343698AbhI2RE1 (ORCPT + 99 others); Wed, 29 Sep 2021 13:04:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:53982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243396AbhI2RE0 (ORCPT ); Wed, 29 Sep 2021 13:04:26 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (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 7D2696124A; Wed, 29 Sep 2021 17:02:44 +0000 (UTC) Date: Wed, 29 Sep 2021 18:06:38 +0100 From: Jonathan Cameron To: Cai Huoqing Cc: Lars-Peter Clausen , , Subject: Re: [PATCH v2 2/2] iio: st_lsm9ds0: Make use of the helper function dev_err_probe() Message-ID: <20210929180638.6ddb313b@jic23-huawei> In-Reply-To: <20210928014055.1431-2-caihuoqing@baidu.com> References: <20210928014055.1431-1-caihuoqing@baidu.com> <20210928014055.1431-2-caihuoqing@baidu.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 Sep 2021 09:40:54 +0800 Cai Huoqing wrote: > When possible use dev_err_probe help to properly deal with the > PROBE_DEFER error, the benefit is that DEFER issue will be logged > in the devices_deferred debugfs file. > Using dev_err_probe() can reduce code size, and the error value > gets printed. > > Signed-off-by: Cai Huoqing Hi Cai, Picking a random patch to reply to... Thanks for your hard work on these. The ones I haven't replied to look fine to me. It might have been slightly better to slow down your initial submission of these as then we could perhaps have avoided 2-3 versions of every patch by identifying shared elements to improve in a smaller set. Still that's the benefit of hindsight! I'll not apply these quite yet so as to allow time for driver maintainers and others to take a look. If you could tidy up those few minor comments I have that would be great. Thanks, Jonathan > --- > drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c > index b3a43a3b04ff..9fb06b7cde3c 100644 > --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c > +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c > @@ -24,10 +24,10 @@ static int st_lsm9ds0_power_enable(struct device *dev, struct st_lsm9ds0 *lsm9ds > > /* Regulators not mandatory, but if requested we should enable them. */ > lsm9ds0->vdd = devm_regulator_get(dev, "vdd"); > - if (IS_ERR(lsm9ds0->vdd)) { > - dev_err(dev, "unable to get Vdd supply\n"); > - return PTR_ERR(lsm9ds0->vdd); > - } > + if (IS_ERR(lsm9ds0->vdd)) > + return dev_err_probe(dev, PTR_ERR(lsm9ds0->vdd), > + "unable to get Vdd supply\n"); > + > ret = regulator_enable(lsm9ds0->vdd); > if (ret) { > dev_warn(dev, "Failed to enable specified Vdd supply\n"); > @@ -36,9 +36,9 @@ static int st_lsm9ds0_power_enable(struct device *dev, struct st_lsm9ds0 *lsm9ds > > lsm9ds0->vdd_io = devm_regulator_get(dev, "vddio"); > if (IS_ERR(lsm9ds0->vdd_io)) { > - dev_err(dev, "unable to get Vdd_IO supply\n"); > regulator_disable(lsm9ds0->vdd); > - return PTR_ERR(lsm9ds0->vdd_io); > + return dev_err_probe(dev, PTR_ERR(lsm9ds0->vdd_io), > + "unable to get Vdd_IO supply\n"); > } > ret = regulator_enable(lsm9ds0->vdd_io); > if (ret) {