Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp197895lqt; Thu, 6 Jun 2024 00:20:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJhLmGx+H5jGFkrsTEvTPF6+hsTtDfSuwhvChM4lXpxx9SoxQzzzcZW1d0gfY3/RmUEEpSqF+5ZzpIz/ToMMfebWManE7XAb8ug9BVzw== X-Google-Smtp-Source: AGHT+IEPWpwzpxIzx/2W34GD9xUx4CnrPEoVnxEzz99xZ+cRcJT7xW+faUPRD/Hx6DAr5V9NCBGo X-Received: by 2002:a05:6a00:2307:b0:6ee:1b6e:662a with SMTP id d2e1a72fcca58-703e5aa047emr5404772b3a.32.1717658447529; Thu, 06 Jun 2024 00:20:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717658447; cv=pass; d=google.com; s=arc-20160816; b=kw0MKWBgPD41pnisIiE64JZflgmVeNGhyawzXwZeC5Y3eaBDsfxArgyQC86zVIDhXT gWi8AUgHo0q4RHA1TeL+wpnKV1mnTFzLPp1B+E0YzY+izE196olMOJUpa6Nc7UXMm+cn /hDYHhiFEPGKLqoYB3toH4/1BfvM3BfC6qGdfpc3nEuc79v0tomlqCjfUGd4p/EBkg3g 3+Lljt9zDO24W//35aQSzJu0ogwo0FrJ20GT5uS+OlCCAUomFK5kacIa52XVPkS85P96 m2NwKuheRIyoYejFQ1ELG48XtY9AZTr9BhQ7vo4/oz9WDwHv7FLs+RxIJbPG/uyKRh5p e35g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=FAj+pgJmEDllgvpSsEUgFzbngKUhGW2y7aItHl9cl6E=; fh=ET1r5CJhIaoJZTGTWiA1356F7s7pFL/kXVVpLEkpmC8=; b=LIEswLvT/shI1DwR0St2sKfyteB6edmkgTmz4noUW+LF3NWCcyml/IGDixrivugRgF 2lJVjmlWo/VkdW1TZU0dr6H9F8Rf1iZEbyLEdVuRDzVhH7kiKLfbk28v0LhczLEcWHqU CoWKEql064Q+8NNIqf/ki1E2GhHgTcYMT5a+70YL+XRrqWtgksu2sFuCIc+biaO8bX1d zvNUngcwXxU5PYGBNh3g6NBHAvZyqXXRPMxR4lVJnnjGwsGYCb3/994L2q94sdwS3Ict /sZRPpGmCa1cZlrY6G4eiFxmKYtNgIgZe4AZZQl7orLukqg8opoLxkVknK3AMGYKst+o hB5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@analog.com header.s=DKIM header.b=EyR9y5MI; arc=pass (i=1 spf=pass spfdomain=analog.com dkim=pass dkdomain=analog.com dmarc=pass fromdomain=analog.com); spf=pass (google.com: domain of linux-kernel+bounces-203718-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203718-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=analog.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de29db0a5asi715715a12.781.2024.06.06.00.20.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 00:20:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203718-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.com header.s=DKIM header.b=EyR9y5MI; arc=pass (i=1 spf=pass spfdomain=analog.com dkim=pass dkdomain=analog.com dmarc=pass fromdomain=analog.com); spf=pass (google.com: domain of linux-kernel+bounces-203718-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203718-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=analog.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 62DFE288072 for ; Thu, 6 Jun 2024 07:20:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A810A13C900; Thu, 6 Jun 2024 07:20:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="EyR9y5MI" Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (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 76DC13D56D; Thu, 6 Jun 2024 07:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717658402; cv=none; b=cWHxG00jvZjU+YQGeePNbtQxHMg51q9OHlac5BsxrnwH0FqM0UqMXtSSbHmwQwL0uGo3D+nlzLjMBmGajH8aEDPG0ieAspNpMGjqZbfXbSMC0Gh0CND0fhA+CUjoiJJnNSBLFQc4vcENRa9nXmiQP26Y3CAW/nL6oaf7+RODlak= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717658402; c=relaxed/simple; bh=OsovVgPh1Oh1YUHUMd1E03/7+jrnPnfqiPtBVblpv9I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=F4qq3H5qMevcthwUhgdjL8XqY2ajRAKHsV02POAd3xcXRiHWiEnZ28yfBBn2+A4HStTnpFmNHwYRhAR0jzy7N8VQTxHxBGSrDe6fp1FhjMUqhB5muOExLjNFgNJZHeUypgMdp6fySfp8sBhS6UmnsI8sRizkImOaeCHjTt5eNIs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=EyR9y5MI; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4565DJtX019258; Thu, 6 Jun 2024 03:19:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=FAj+p gJmEDllgvpSsEUgFzbngKUhGW2y7aItHl9cl6E=; b=EyR9y5MI0AS2aeuUGJ/j4 J3JI9+z/wzeu4RcgmiA08/Vj8HOmVe/7VXavvbQxUOWC+/kO5QgpXUTfWQO3mHC/ 2CNCGRZldRdtmPZUWqoZP7cDeI6ELB7LCmGKBzm8R0AUQkRPtSbszuo67/QcfUcl 6XcStHOQHPUbpP7RQ5ZTOdoWH/1mavAzFGpcgvi89YprM0vccUXKLtQBjc97va1+ ZuWcqYLz0LI9WQLGdUxJpbtWtR3VPAYSkVfK/tdpwmAMWHDM91FbnImGnBuOCkKa mJqKxFHZEjbzJA3f4lnekG7HNfZw+HGGi4MVj9LorqoX9vO/rGQVm7QlezcsSMCG Q== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3yjuesjmhf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jun 2024 03:19:20 -0400 (EDT) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 4567JJqs030130 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Jun 2024 03:19:19 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Thu, 6 Jun 2024 03:19:18 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Thu, 6 Jun 2024 03:19:18 -0400 Received: from [127.0.0.1] ([10.44.3.54]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 4567ItBe025782; Thu, 6 Jun 2024 03:19:14 -0400 From: Nuno Sa Date: Thu, 6 Jun 2024 09:22:39 +0200 Subject: [PATCH v3 3/4] iio: backend: make use of dev_err_cast_probe() 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: <20240606-dev-add_dev_errp_probe-v3-3-51bb229edd79@analog.com> References: <20240606-dev-add_dev_errp_probe-v3-0-51bb229edd79@analog.com> In-Reply-To: <20240606-dev-add_dev_errp_probe-v3-0-51bb229edd79@analog.com> To: Petr Mladek , Jonathan Cameron , Lars-Peter Clausen , Olivier Moysan , Jyoti Bhayana , Andy Shevchenko , Chris Down , John Ogness , Greg Kroah-Hartman , Andi Shyti CC: , X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1717658563; l=960; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=OsovVgPh1Oh1YUHUMd1E03/7+jrnPnfqiPtBVblpv9I=; b=8HR2zinO2yjseNWZUlbrgIBPYWeDOT94XjWOgTzUO2wWlwq9+l6LQFcetEj+J4MKCQc5lSNp0 ccBuW2plZhiDy/W6DaYnC9LFxkKP/imSdgp/snT1OLcyIvV/br2cwWk X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: DboaPG8eU8Ky7JiiQ4xIWNClf_G4S1dV X-Proofpoint-GUID: DboaPG8eU8Ky7JiiQ4xIWNClf_G4S1dV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-06_01,2024-06-06_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 impostorscore=0 malwarescore=0 mlxscore=0 clxscore=1015 priorityscore=1501 phishscore=0 mlxlogscore=999 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406060052 Using dev_err_cast_probe() to simplify the code. Signed-off-by: Nuno Sa --- drivers/iio/industrialio-backend.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-backend.c index 929aff4040ed..efe05be284b6 100644 --- a/drivers/iio/industrialio-backend.c +++ b/drivers/iio/industrialio-backend.c @@ -561,11 +561,9 @@ struct iio_backend *devm_iio_backend_get(struct device *dev, const char *name) } fwnode = fwnode_find_reference(dev_fwnode(dev), "io-backends", index); - if (IS_ERR(fwnode)) { - dev_err_probe(dev, PTR_ERR(fwnode), - "Cannot get Firmware reference\n"); - return ERR_CAST(fwnode); - } + if (IS_ERR(fwnode)) + return dev_err_cast_probe(dev, fwnode, + "Cannot get Firmware reference\n"); guard(mutex)(&iio_back_lock); list_for_each_entry(back, &iio_back_list, entry) { -- 2.45.2