Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3749524pxb; Mon, 27 Sep 2021 01:28:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRteRfiCCllWeq8ps3IkljitM/BbORClhlFKmqr5Ci6evmwQE0NbVig/JT/rVZQqLXPUb8 X-Received: by 2002:aa7:cdd1:: with SMTP id h17mr22497721edw.346.1632731300756; Mon, 27 Sep 2021 01:28:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632731300; cv=none; d=google.com; s=arc-20160816; b=M2lNIb5hAdUyQ/VfDvMp1uWTMr1EZKCSceo2xeb8Z6HFpwJN6+L9T3+e3ItOSEyk8c lLlpvi46JNqUitX4fqHUJ5c0QVL+s0LtBj1nvFOXcEQufQXg0f63GCcIHe5MVUZ8GxXJ MDqDTUiYzIWvxVntzRhzjfV3SPpqQPcHOiRfGjhPTp+sAf34o2EiS2PPBc3QzclKJmp+ RwpXdWoLn6JW53QJUq30yl0HH3O6WvRB5FSBxw1oJci91KAh5FPu+KuhJkJxGbdTcbzH QqyqqmQh4SietWK90aeMjsXdQFh0YC7IGSPlBqXZtc5x9Q0tWQcBH5SZXPh4rt6H0Vi5 bRYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=7Cc4yqAQsbr4AwDrjiGzlnIPUwxwFH4bDEbK7aFLXVU=; b=JL1bHO6ig8c5autBE0ISkycSjw0KpVJISfconqFVosZv1Z0HSENwPXrMYzJ8eKbLmC Tohle72AxYjT9RGbHaqtdzin7noNFdfDMt2+SW+gZyeovPTIbqgcigsFTLETGErQwa/Z +7UraN/rjW5gr9txts2tg9XoXUiZvmUqL79WcLQwLaXPXcjRDEEDKP0avMi7M1NlIXoq sqQ1kFP2lNiQMlOmBvd1UfrguA86TD6Xzfs/JY7MlUiaqefFAsUvxn5sxzeCb2ugI1sq REaYYhfEwGoqzZUbUil2nydPeucpHNqVDAUAUnV5CP9L7bcgaIKGnqCotAPZrg38HHoj vpCw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z3si1817156ede.156.2021.09.27.01.27.57; Mon, 27 Sep 2021 01:28:20 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233493AbhI0I2I (ORCPT + 99 others); Mon, 27 Sep 2021 04:28:08 -0400 Received: from mx24.baidu.com ([111.206.215.185]:60912 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233499AbhI0I2H (ORCPT ); Mon, 27 Sep 2021 04:28:07 -0400 Received: from BC-Mail-Ex10.internal.baidu.com (unknown [172.31.51.50]) by Forcepoint Email with ESMTPS id 42B7D2C1A4CE0750EF77; Mon, 27 Sep 2021 16:26:28 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex10.internal.baidu.com (172.31.51.50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Mon, 27 Sep 2021 16:26:27 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Mon, 27 Sep 2021 16:26:27 +0800 From: Cai Huoqing To: CC: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , "Vladimir Zapolskiy" , Marcus Folkesson , Maxime Coquelin , Alexandre Torgue , , , , Subject: [PATCH 4/8] iio: dac: ds4424: Make use of the helper function dev_err_probe() Date: Mon, 27 Sep 2021 16:26:03 +0800 Message-ID: <20210927082608.859-4-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210927082608.859-1-caihuoqing@baidu.com> References: <20210927082608.859-1-caihuoqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex15.internal.baidu.com (172.31.51.55) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/iio/dac/ds4424.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/iio/dac/ds4424.c b/drivers/iio/dac/ds4424.c index 79527fbc250a..5a5e967b0be4 100644 --- a/drivers/iio/dac/ds4424.c +++ b/drivers/iio/dac/ds4424.c @@ -232,12 +232,9 @@ static int ds4424_probe(struct i2c_client *client, indio_dev->name = id->name; data->vcc_reg = devm_regulator_get(&client->dev, "vcc"); - if (IS_ERR(data->vcc_reg)) { - dev_err(&client->dev, - "Failed to get vcc-supply regulator. err: %ld\n", - PTR_ERR(data->vcc_reg)); - return PTR_ERR(data->vcc_reg); - } + if (IS_ERR(data->vcc_reg)) + return dev_err_probe(&client->dev, PTR_ERR(data->vcc_reg), + "Failed to get vcc-supply regulator.\n"); mutex_init(&data->lock); ret = regulator_enable(data->vcc_reg); -- 2.25.1