From patchwork Sat May 20 07:11:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 96737 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp201485vqo; Sat, 20 May 2023 00:20:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5wzwKEquZ140YYqzR4h4Mph0YveWP9OvdD1uY3L0Omu6RGf28vtI22XDNDocujoBPebYrN X-Received: by 2002:a17:90a:74ca:b0:253:8469:db5f with SMTP id p10-20020a17090a74ca00b002538469db5fmr4083243pjl.46.1684567253676; Sat, 20 May 2023 00:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684567253; cv=none; d=google.com; s=arc-20160816; b=f9PKX94uHz/dRK4jK/gUuUBxd5kA8ar3bo5UU2sotyVxtZRcINpQGbhGq8z+S1kH/6 jaPUhH6SSChpjTUqkXbbOea0VmzXF/XautAGhRDiJWFy61KB25jMUFRtP4NW0LzLySsa BsXWfSYQoA8jG9Q5wPN8a4G5s4DYvYElLLXq5AxEWt8sX8WEroVKoFvtMRCQ8yp2Jnxa j07gM1888gIjKm0Aw6pyp5oebg5zHiu28AxpS/16FqSN3aQZJ60bfg5exEUL1h6umVFc ajME/cGbjArLdh0J0FdJ9uz3ceT6ArCtJGY6Nq6lsun0IUvMO6ouvQO4gjwvsOMou5Qh xhnw== 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:date:subject:cc:to:from :dkim-signature; bh=VFjzBLHfhQsZzoJFtk+tIh2Z2Xhz+SOk2hnwtR5F5/8=; b=v40dWMK2BzgfeGdQ+xy99VNdvbSb/LEQ0pAr5qRTgXzxwqMVDaLLkbSpmcffmDRp/q 9GPLOn3ZGq75hEQyku4GWpiMfvvjR1oEa0AAjhcSEGqRD6JzkmGWnb/JCY9qIb4GZMiU CQPsXAd5NyCaB9BRxnCsxQMWpVeowNIm35qK4OFFREXdxwOdESOSMVQpdY6JuyAfdoof z5LQ7qvdlwHIDoHtvkpZRmxBf3u5wMHPqt22xvQwGPbzv5kuGaBvdkMSkuZE87lQWpnZ Xc1oBC72lxcx/ki3PucB+/D4mfnYR3ULQ/ZkVkX3TfDiNjpbjvyyZSVJvOs/XrAtNaV4 mQpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=gZIYGipV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q189-20020a632ac6000000b00534748f9cd8si1071257pgq.644.2023.05.20.00.20.32; Sat, 20 May 2023 00:20:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=gZIYGipV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230018AbjETHLL (ORCPT + 99 others); Sat, 20 May 2023 03:11:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjETHLK (ORCPT ); Sat, 20 May 2023 03:11:10 -0400 Received: from smtp.smtpout.orange.fr (smtp-13.smtpout.orange.fr [80.12.242.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ACFE1BD for ; Sat, 20 May 2023 00:11:09 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 0Gk7qZUTZEQ0Y0Gk7qts3h; Sat, 20 May 2023 09:11:07 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1684566667; bh=VFjzBLHfhQsZzoJFtk+tIh2Z2Xhz+SOk2hnwtR5F5/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gZIYGipVV9Y4wpoaG1QQOBvBgDEiE428BuqGFIX1gqxPpi0KdfnBBQu9bSB3wnmCg 7EzstYJn3mlm9bOMx3hDyRCkD9zEj+LeWGir81pLUs98sWBo0K1RmyAPPiP7DFd5oW 90O7twltgmBEhN1gqd33gvckuN3/XqvqGOWJkICYdcyOoZx5GYbOwnp+sGa6VlQVcQ Y6g6+dFIfmK6cgM7hvCP4p27LtBLMBoZdvPe1tWFa5hCYlLFGMLNSG7feLQR3Wz4zL QaScYGdILL8ywj4COQhM0xp9KgGHwHdJi/W9/Nn/fPGi3kEZeuuX/QRZOmorEy6Lmf Eb2p/acrFLUxw== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 20 May 2023 09:11:07 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Lee Jones Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 2/2] mfd: wcd934x: Simplify with dev_err_probe() Date: Sat, 20 May 2023 09:11:05 +0200 Message-Id: <73fdc6ecf619f80fad126abca11fb579d3d87f64.1684565021.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: <02d8447f6d1df52cc8357aae698152e9a9be67c6.1684565021.git.christophe.jaillet@wanadoo.fr> References: <02d8447f6d1df52cc8357aae698152e9a9be67c6.1684565021.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766396792473563015?= X-GMAIL-MSGID: =?utf-8?q?1766396792473563015?= Use dev_err_probe() to simplify code, save a few LoC and be consistent with error codes handling in messages. It also filters -EPROBE_DEFER that can be returned by devm_clk_get(). Signed-off-by: Christophe JAILLET --- drivers/mfd/wcd934x.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/mfd/wcd934x.c b/drivers/mfd/wcd934x.c index 281470d6b0b9..6b942d5270c1 100644 --- a/drivers/mfd/wcd934x.c +++ b/drivers/mfd/wcd934x.c @@ -227,10 +227,9 @@ static int wcd934x_slim_probe(struct slim_device *sdev) "Failed to get IRQ\n"); ddata->extclk = devm_clk_get(dev, "extclk"); - if (IS_ERR(ddata->extclk)) { - dev_err(dev, "Failed to get extclk"); - return PTR_ERR(ddata->extclk); - } + if (IS_ERR(ddata->extclk)) + return dev_err_probe(dev, PTR_ERR(ddata->extclk), + "Failed to get extclk"); ddata->supplies[0].supply = "vdd-buck"; ddata->supplies[1].supply = "vdd-buck-sido"; @@ -239,16 +238,12 @@ static int wcd934x_slim_probe(struct slim_device *sdev) ddata->supplies[4].supply = "vdd-io"; ret = regulator_bulk_get(dev, WCD934X_MAX_SUPPLY, ddata->supplies); - if (ret) { - dev_err(dev, "Failed to get supplies: err = %d\n", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Failed to get supplies\n"); ret = regulator_bulk_enable(WCD934X_MAX_SUPPLY, ddata->supplies); - if (ret) { - dev_err(dev, "Failed to enable supplies: err = %d\n", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Failed to enable supplies\n"); /* * For WCD934X, it takes about 600us for the Vout_A and