Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp92239lqp; Thu, 4 Apr 2024 07:55:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXqr42827bwICYis73pEwrvRkcJd6HKfTLrlqOHMV+PP5ns1Vy7wdl+3NeiAOqZNK6KDSX3ZZMBMB9ZxDZqkzWI20LnH6fNNGs3Hc+g6A== X-Google-Smtp-Source: AGHT+IFw+FIJVRtKefbjj0y1zNiXrxkATvAFbopzcUAvgruPA38fa9k9C1Vc81oVsdE1VB45+z4g X-Received: by 2002:a05:622a:196:b0:431:51d:42b1 with SMTP id s22-20020a05622a019600b00431051d42b1mr2064050qtw.42.1712242507603; Thu, 04 Apr 2024 07:55:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712242507; cv=pass; d=google.com; s=arc-20160816; b=TpJngQP1BGGS+8dFxlcE5qjC1cKfXuXEMLxzzDZ1FARW2kF2u5THim8qhY1y6trGr8 PRQjtt8OGRjSA4zs6wgEcn5e9pwB7y5ILm5MLUi3V23MWplwPvJrRErRkj3UuZExelI0 Y0QKcwZB8IuWMn+2tHd8npASq6fLG5ro8Fc9+MVskPAjKIcOks75Eagh4RjOG9XmIHUx 9VG7s1RuiX+nhahWR0boNVawCB+idoEZmbVWDaLIGGouInaqa6jqBqEgXMMsfPSL4qcO xgVJZljUFiKLMaGLml37q1x5pw8vkphXcAVv6lQ0nAZxVR/XwJoVyJKs/CQrHFgnrUH6 0cBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=glulz4AZ62PEl1FtV867d3/xaAkvpKKca8G8SD97D8A=; fh=mL+HaAz3ORlBrr1+/nUg+/q0ZUN7PwERrHWr7Dxaa1E=; b=XnxxcoTDbvxPxRF1E9pvH/OSR07yLcodnm3FWvbvxMD7LWpo84o5wWF71AULnuIhuK 4G9FysXUcoA0MF56l1cCOXt1PElZPPC3xleVjGGumNVZHjW/LawF1OfJgiZrmzLfnGQh 399ME+kXyC8ZY88g9YqNZ93lGswY4nUWQ6SS1uzraOvO6VFqjUnWhySL/txzs/HZtfrw KDRzaPHp2UHsJVzqYX5TpXx0fWsu/rbyq1gAFNhABOeW515B0l9AWmUC8aoNjmhPKVE5 8O5fWfGSDWMbVGETsQxuruwmv6QKc4Mdf6JU7KOOpvlzYNixsnTywitrsIMiJXGQVSRH OT9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Ks+2N8TU; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-131657-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131657-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id dp9-20020a05622a47c900b00432c8c1eeeesi12292673qtb.616.2024.04.04.07.55.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 07:55:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131657-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Ks+2N8TU; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-131657-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131657-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 50B831C21363 for ; Thu, 4 Apr 2024 14:55:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FE001C696; Thu, 4 Apr 2024 14:55:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ks+2N8TU" Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D4AADDBC; Thu, 4 Apr 2024 14:54:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712242499; cv=none; b=YtKFz4bScNqTx/KmJeb4XDGo3miqx7ybVsYrqFDblDfjHd+ehT2gB1s82iNlGwpGXQ1MNhx3X75tJzeDPWTfp6CqOtDpggcRduzVtHgkQpEtTbY75AnwDqN0yL6rOGi5LZXKeRn+uBaiGRi3w9+Oqn9Fkg197RD/kQ955oPECnI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712242499; c=relaxed/simple; bh=x78rj90TFRZ7cOjs3pNg4nRwg+XPusDjo2DznyCzO2s=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=V+agLvvNyNjlnqGJr/+U81y+i4AUhS0GaWE+1TWT5uUDUo4YAC/M9vQcxeQYM1L/Hq1fvxWMbKavSThhoO1b0ChSjQJp239v7jlXLbPkO3Tinkk+MM2PRx9Mf/KJS/MGslcwgcTg6b8bjFEovVR5N9xXdHFFQipmhNXFBpYYNnk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ks+2N8TU; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4162bac959cso4018085e9.0; Thu, 04 Apr 2024 07:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712242496; x=1712847296; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=glulz4AZ62PEl1FtV867d3/xaAkvpKKca8G8SD97D8A=; b=Ks+2N8TUYpRAhjzGJikLruvc75rlHWsOMiVPPg7isgygq7Slj+LaPdKmat+CiHPx1b MYfpRY5mFn7jouCLcVQj7MF3m4V2ANPP6cTRXyulcu2GiZkVdKhVqOn74UD48dv5ZUcQ a7zbJxmKdXmvQXk/nSTXgGuL5eUtTyYlkpjW/6WAbQ7ibJwgAfccRgl8HRPl+t0mvrM0 g/5H0KkZnjzQRIThgS1sGvsTrzlay4TMVYf0kDXNuFJjzgkGUceNtqBe+zl5AFwU3npm gy3O2qaAHo6AhA7LTZE2SWUUuAnsrgl+m1EdizRk5k40v+i7Fa4ea6ZD5IKLoK+3yfyd /NCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712242496; x=1712847296; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=glulz4AZ62PEl1FtV867d3/xaAkvpKKca8G8SD97D8A=; b=JVYPozf4UZriv4pMfl83z4/6Z14Qf8xlkMv+Ny4qggHqCJRtq5+oVqsuswP6yewKsz PhhqA2lCVWWimYNCKSBdPvuSjwBpe96uxXCz2XfF03nPmu1gF8EAagHcDQrdc2f1ktz2 POFu6NgCryYLt3SHya82NAS72Rqpl5dDNN61dQOKhTpYAeB18fpSDEEMq3wMTNAro4OO 8pwHD20Cle2ZOA2gm63QrD7YxVJQRIkNn+aAZvV/byxeefBv6qUv9yFxZHuVL3jozBtp tFfttm3y7xL+gMUILAGY27hhw2Mp3po14wzB3dS+Sbn/15DikmZFOXF1uBYHn80/HY1k yFeA== X-Forwarded-Encrypted: i=1; AJvYcCUBSV0z9PjKOF6BYKRF46yuJXGtn/+CHq7MRAmvjkEJK35CKyyeV/U5G3oPZ2NyNN56tiKCkRg/Q7lFsUZBTn/x2XMOWQes7vSXZ4GUq4+YSrO/Eq3Ob2W8r4CMJD8My7IU28FQHoRB X-Gm-Message-State: AOJu0Yx39f7Xyoah5hz87qI0Fi5t5p+t2Pi9GjdQ1ZF5OKx3WI/Ga+xF +2Ndj545hEgpO8MiJZuFmzyCOfVzqC4iXqxqxTsWOKoSDr5I+uKd X-Received: by 2002:a7b:c450:0:b0:414:ff4:5957 with SMTP id l16-20020a7bc450000000b004140ff45957mr2153060wmi.5.1712242496120; Thu, 04 Apr 2024 07:54:56 -0700 (PDT) Received: from ?IPv6:2003:f6:ef1b:2000:15d4:fc17:481e:8afe? (p200300f6ef1b200015d4fc17481e8afe.dip0.t-ipconnect.de. [2003:f6:ef1b:2000:15d4:fc17:481e:8afe]) by smtp.gmail.com with ESMTPSA id n10-20020a05600c4f8a00b0041493aae77esm2963505wmq.23.2024.04.04.07.54.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 07:54:55 -0700 (PDT) Message-ID: <9f91388faee750e16021f2c0544e7a158a16202b.camel@gmail.com> Subject: Re: [PATCH 3/4] iio: backend: make use of dev_errp_probe() From: Nuno =?ISO-8859-1?Q?S=E1?= To: Andy Shevchenko , Nuno Sa Cc: Petr Mladek , Jonathan Cameron , Lars-Peter Clausen , Olivier Moysan , Jyoti Bhayana , Chris Down , John Ogness , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Date: Thu, 04 Apr 2024 16:58:27 +0200 In-Reply-To: References: <20240404-dev-add_dev_errp_probe-v1-0-d18e3eb7ec3f@analog.com> <20240404-dev-add_dev_errp_probe-v1-3-d18e3eb7ec3f@analog.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Thu, 2024-04-04 at 15:23 +0300, Andy Shevchenko wrote: > On Thu, Apr 04, 2024 at 01:06:25PM +0200, Nuno Sa wrote: > > Using dev_errp_probe() to simplify the code. >=20 > ... >=20 > > + if (IS_ERR(fwnode)) > > + return dev_errp_probe(dev, PTR_ERR(fwnode), > > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "Cannot get Firmware reference\n"); >=20 > ERR_CAST() seems quite good candidate to have here. >=20 > return dev_errp_probe(dev, fwnode, "Cannot get Firmware > reference\n"); >=20 > (Assuming dev_errp_probe() magically understands that, note you may have = it as > =C2=A0a macro and distinguish parameter type with _Generic() or so and be= have > =C2=A0differently: ERR_PTR() vs. ERR_CAST(), see acpi_dev_hid_uid_match() > =C2=A0implementation, but also keep in mind that it doesn't distinguish N= ULL/0, > there > =C2=A0is a patch available in the mailing list to fix that, though.) >=20 Do we care that much for going with that trouble? I understand like this we= go PTR_ERR() to then comeback to ERR_PTR() but this for probe() which is not a fastpath. So perhaps we could just keep it simple? - Nuno S=C3=A1=20