Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp557041lqh; Thu, 28 Mar 2024 09:22:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUaW/ydbzMNgquMF9+zyQyv+COcqDTbqgFHkY3Xnl6zO1wXc0wyY3dSZBiYGJsTBZevSkLiKgIja5/1m2gZ2+4o6WqQhKuNqh1FJCig9Q== X-Google-Smtp-Source: AGHT+IGbUna5iMFlocQg04/Md3I/QIDeJ0sewk8bTRQb/eqIeQYTFuKtc4wmtdxQWUEWKJKcTn+J X-Received: by 2002:a17:906:3497:b0:a4e:863:f4e1 with SMTP id g23-20020a170906349700b00a4e0863f4e1mr2137058ejb.16.1711642972540; Thu, 28 Mar 2024 09:22:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711642972; cv=pass; d=google.com; s=arc-20160816; b=Km+jvg6JDotuzDwegt88RRrYrV7IRddEEKgcmsEfmQax0HPsjogsiYpbljI1c1qcXr 21a0bSRKhsn40dlh+ZTQHxNrPIfD9Vk/l0BZrgWZv5Zz6hnDp43vZcLFS794GRNy1Qp7 7hU1Qhr77APpsNp4ekSEWO920MmDNZHvHxwJFBWZuEZBn1nL5mlpxT6yWXDcyMZ8OIIR S1ryXYW9BaUj/Itj51fthYx6ZHCYTYyLXLOZqH8gWDZyzoxZhw9vBO0OuVQHoN1hwY3B 1G0pCek3ccYgY+qa8L2fLXCsDHW3U+sEzCu5E2JsjUvLrScqHPY15olqFPbn+8h2s5Yl iheg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=EnJlUvy1qxNgIZXDGcXX0DA0GUJfYm+TOzhexRlGQSE=; fh=eLJ0ZkbGfa/aqy/dGSdsvXDgUwptbVw94nQm6NI/Hjg=; b=ZJCDjuD24mktRCkFzXyOKvhgImBULxdPoZW6ku3DAU79lV808UTwBYNDb72R0fykZw KjmYMoV/BmLNfSRkfg+b5Fqgwux7fca7d839EAIEABLTbkmjQLSTaMVyiQx/3HZZwgk3 FdwJ0odqLxSKesJ9QE5uD7LjrZDuNo1sKMu8T4zu6x+UYWtYqx9N8JE7VIAljXfqIf8c sCWQSk7laDjxE+j1zcO+4Mc80TD8y4tALFvso6NIIr5KnExVs+hhBCG25IdrEVS91cXd uVOE/qSrkjsjoXXD0UTKuOTn0foFp33g7dXITDMjFnnxSt/MvjjxerW0ZLcIrbpzx23K gsRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ojg0VOK3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123240-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123240-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id kn11-20020a170906aa4b00b00a465f035922si840138ejb.784.2024.03.28.09.22.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 09:22:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123240-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ojg0VOK3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123240-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123240-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 46C3F1F25565 for ; Thu, 28 Mar 2024 16:22:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4FD8313699D; Thu, 28 Mar 2024 16:22:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ojg0VOK3" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61B211311BD; Thu, 28 Mar 2024 16:22:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711642927; cv=none; b=TBSZA5LT6XO4DfiQCyoewETyULKXA+HcREHjTeNQy6jkSmGU1BuMj//cpE9qvwYk8uv4S7enFu0DzHPSsxBA+w8TvFLXUrYpsED8tL+idvCrB2Q5BEiQeuzG4eqNAhSC5QgEFPs6Wdr47SZ0zCf9PhZ/+gjtl7y3x8VndeKdNn8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711642927; c=relaxed/simple; bh=s+jTi4eJig4V+cSHfB9rBekx4dnzA9Bu1DuFXptHNpQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nXDnblZEEajlydt9oVbAQddNb4sCA8jQfQEfUe1eVGY5TfkXdp3EWLVhFpj+wveSqJWt7ult27s9k1+TLOcsJbZR8xHILkHqUuhOqkZpEP0Z6c6hAevj9YVBXYsQaL4v+qC0/jdVdtGmBxzZfWeshvxNLDhsP752DUYcSkbLcHc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ojg0VOK3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id E5F01C43601; Thu, 28 Mar 2024 16:22:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711642927; bh=s+jTi4eJig4V+cSHfB9rBekx4dnzA9Bu1DuFXptHNpQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ojg0VOK36dkUZTGUyrfCFZ6o73o3F6pypuXPK2ObWRc0fH/rpi1y36tOSTcn/Fyqy /SeglpK3POw9slfvWRO1Y4KuexmMvlMUq9jnALfXV2+R6PFWHhqTHzt6cBMpJKb6vv 3V/6E+0xA6D0uuvegjM5e44VoDvPxg3ooRInokOPWw5dqncyFJXy9eJ5YpgB21l0qM Jzh70QLyN/UWj6zG432Z0lc/dItSB4L3I66mwEJrKmIvCbGPH8zbhdjfGSIh5FA4h7 C4TXvCwHD0BxUMZXqSZg+NCeMUCAnYUh557SdW4aA4If25U586V31eyPjP30e6YOsw 5e0Xr1gWu7oLA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5CA5CD11DD; Thu, 28 Mar 2024 16:22:06 +0000 (UTC) From: Nuno Sa via B4 Relay Date: Thu, 28 Mar 2024 17:22:01 +0100 Subject: [PATCH v4 1/6] printk: add new dev_errp_probe() helper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240328-ltc2983-misc-improv-v4-1-0cc428c07cd5@analog.com> References: <20240328-ltc2983-misc-improv-v4-0-0cc428c07cd5@analog.com> In-Reply-To: <20240328-ltc2983-misc-improv-v4-0-0cc428c07cd5@analog.com> To: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Olivier Moysan , Jyoti Bhayana X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1711642925; l=860; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=vXOLsOw6+C77AIWiu90FWpD8kygNarvvpJ/k/VruOcs=; b=64nglCnPkvcJectWPXgIGHdCtTNeyHylZlWDbeBrURS5fXiWuIaps6bEP0qGZsmALZb8I1CI0 vZgLbagCniUC49mYmTeUqCiM6uaPJg7sZbVwEMLKpfJnk2m5TgGd2VF X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa Reply-To: nuno.sa@analog.com From: Nuno Sa This is similar to dev_err_probe() but for cases where an ERR_PTR() is to be returned simplifying patterns like: dev_err_probe(dev, ret, ...); return ERR_PTR(ret) Signed-off-by: Nuno Sa --- include/linux/dev_printk.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/dev_printk.h b/include/linux/dev_printk.h index 6bfe70decc9f..64484d092a77 100644 --- a/include/linux/dev_printk.h +++ b/include/linux/dev_printk.h @@ -276,4 +276,9 @@ do { \ __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...); +/* Simple helper for dev_err_probe() when ERR_PTR() is to be returned. */ +#define dev_errp_probe(dev, ___err, fmt, ...) ({ \ + ERR_PTR(dev_err_probe(dev, ___err, fmt, ##__VA_ARGS__)); \ +}) + #endif /* _DEVICE_PRINTK_H_ */ -- 2.44.0