Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp337359lqt; Thu, 6 Jun 2024 05:23:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUJ4r0/L2Q0ZU9fyYX3EFgci0fF0K0axm1F6Ypjnmtfck2XU4ccnCqk+c6i0beBSss/69v3GpTN3gs5/t1AkUb/bW+MHeumwY+//LpuPA== X-Google-Smtp-Source: AGHT+IG/nzfah0iKhKWndJkxXeMWEs6XObkR9q884SFKwe6W7qj8Vyr4Xf3FQEQzgW1vIdYIiN01 X-Received: by 2002:a17:907:7655:b0:a68:faae:d287 with SMTP id a640c23a62f3a-a69a0268619mr333243066b.75.1717676609124; Thu, 06 Jun 2024 05:23:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717676609; cv=pass; d=google.com; s=arc-20160816; b=RinpIbJRlXncKab2qVohsTvXNVMMUoa87FzYwTeRtcAnKJfXhqENDh1QmVRmY3/Soo Lc9snFJwzBqL2wNhWcHCgsGr2ou+gGyEbBKRzrQ1vozGFNH3h5zdQ7xebdctNshjIv7A lv2YVycBKMMS30TGcFm5RmwCQeGPnfI35r+2oF+P6JN6NzodSMNnk5vFI4oovKCya2J4 1cag1jErBCTa+x77ocSYzFT0mt5RvkSzHnLK7jxMYte1RWsQJjZEZm0FdAPncPf2E/Fy FbA2cjZpVallL5CpzUFlo7l9iDjHqJfiPAM8ffuctmk83ORF2bOxIwiI4RJg8iR1Ryju Dvag== 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=gzXR/OvjO7v9S+Oeo5jOyL/ZCpVVTFjEqhMz5dsHPGw=; fh=akGwRKSS2cwArmMs7wuw5HeWlPmw2+4S69BcK0ys7uM=; b=i3EP8Hsidv+riUtT5/2gmY7jLZCK5GktkWCGgeegrAm7S2NheaPliR8TU5tItQ+ySQ G5gKoM54huaf+Zrf8qRGqC4I7i+cFR12gbeYn8FdRgm2Pup31TU+OZu1VKmNhSYCKPil ZhhRJsFrHBunR3yc+kWsQMofC322/PyhVM48JSLkIxGArNndRGIPcwUdxuMw1nfusQTF DYub6rpT/0Mj2UJsJsqIKT2X2gyLGAeAYQMOo+/9VL+77JwsL+eiDVVi3F5mQltPbORG ovVMuFPUgppzCkh2hyDtPi8xmbWcX4vxClCmBsF4OV9/fefHMckTODCIWqITfYryFnJ6 yQAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dtpaQgp0; 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-204264-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c80580f66si67438266b.34.2024.06.06.05.23.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 05:23:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204264-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=@gmail.com header.s=20230601 header.b=dtpaQgp0; 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-204264-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204264-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 am.mirrors.kernel.org (Postfix) with ESMTPS id CD72C1F223BB for ; Thu, 6 Jun 2024 12:23:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7BB5B19597A; Thu, 6 Jun 2024 12:23:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dtpaQgp0" Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 32E9013B28A; Thu, 6 Jun 2024 12:23:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717676600; cv=none; b=Cg5m18R6bchPiOLB3a+xcET6kbeFoGIf17RRPaWF9Tv4g88NXSOQ2IYSk7z17anvfSnRFwZwnG3xHkuz8hv5Jaj2JdxJ2PTT2HFm0gNLqYMBYaTtJhtRWMuTbofgP8UCkCWs2J8HzmD5XM73XArQgdrWcaor5dQREl7TffYCQb8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717676600; c=relaxed/simple; bh=8pn8/jGprupn5WDXqc5TOyZpP+OyIaCyvmTNaUMSJkk=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=GzZBk2dvKkcEJ+U8Z4kDwKTkQGKhIcENatDCxMs0v4Zf3aW1G2VhBWSljn4RXFn00JdSS8nQo7Y6tjn+A+KEoMW4feW/+nETzIasvh/ey31O421ofUifpx6XkO4B3Asy7pHSrsQqzxhsLVDazvCk5dSGngyMwlWFwbuYdLsjcPU= 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=dtpaQgp0; arc=none smtp.client-ip=209.85.128.43 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-f43.google.com with SMTP id 5b1f17b1804b1-4215ac379fdso8948175e9.3; Thu, 06 Jun 2024 05:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717676597; x=1718281397; 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=gzXR/OvjO7v9S+Oeo5jOyL/ZCpVVTFjEqhMz5dsHPGw=; b=dtpaQgp0UciRolzV1KM2VxMXAFFX8wE2i2slZNaUDlnIkoM78U+ejmw3fLuzNQgIBN cdyiWtmM83l9tbyqtacn6SvT9pJPZmQq59on/6rZ+IfeRX1j4sdkKsVVPfvhY1nSHopN 1XyqkiNIoG8XQ1aguLmyEYpWyBDdsNLnIWHqgH323FrUjDApYzudlYIQPkP47vUb4/LS UE0QoA/6lL8F3QzFir88AWCQIu71B+GDLpKwI273sfVf12QHtQiMQbFybMoVZ5385xdr AfJwmmknbTq8g7/f00RSaMZm1EZ+b1I+svbToiBI4ubYJhL1/fu5WToFU5br8Cur1MUc YaoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717676597; x=1718281397; 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=gzXR/OvjO7v9S+Oeo5jOyL/ZCpVVTFjEqhMz5dsHPGw=; b=tRUEfbTszKnJEdTLL84EBAtpYxBVo3R/kijitS/0QEGA8iJAreZuPjyhAkTKixIRYw s5IWlKNczaISwE68KLJmXU3SfKDJwPHEHjb6yPjhukbbyCDLdmVCcm3ADLEVBZB07mpX 3tGOta+0eY4HgZrWMRx3tw4Eq9DlEpKiopNDD2z6RIHp26HN81AMIfesnpk7lZMt2yYt qq0GRf6vnN21HAIL+ZHLmWIQXuaPEWkQphQtMXRp5peeQuQD0dHKBa5EdTUGF7XuqOr5 uw7Ofk7eUNz0bu6UZBQCM2AD2m3IdrcxBsFyxOOyDMTKHhcObJdJ9KUrGgx9Nh98himt vIfg== X-Forwarded-Encrypted: i=1; AJvYcCXWrvwRHgBQFjZ642/mNw1sCL/Pj/gHhQ8JrAmRUT5g1fGzBl64Tt0h3vYPQP8NDgX/Tu3L1NyupRVgEPjtH0VihRXMut2ED/OvKJ0cqL9YwEm9AqU0s1Nh0cO/p7EjJgVxfNiob05R X-Gm-Message-State: AOJu0YylfPMXnJYX9vFG+wHGuUiK9/p767Wt/wco8qzvhkfUHozsKDZ3 y/AJHGsqaY4aF68KTIAFawpxkUXPkRnEEvTVyG38IPtsoHdeqOGz X-Received: by 2002:a05:600c:4f0f:b0:421:2a43:6518 with SMTP id 5b1f17b1804b1-4215634cc35mr40922135e9.33.1717676596946; Thu, 06 Jun 2024 05:23:16 -0700 (PDT) Received: from ?IPv6:2003:f6:ef1c:c500:994e:fbde:478:1ce1? (p200300f6ef1cc500994efbde04781ce1.dip0.t-ipconnect.de. [2003:f6:ef1c:c500:994e:fbde:478:1ce1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215c2cd18asm20066655e9.39.2024.06.06.05.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 05:23:16 -0700 (PDT) Message-ID: Subject: Re: [PATCH v3 2/4] iio: temperature: ltc2983: convert to dev_err_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 , Andi Shyti , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Date: Thu, 06 Jun 2024 14:27:03 +0200 In-Reply-To: References: <20240606-dev-add_dev_errp_probe-v3-0-51bb229edd79@analog.com> <20240606-dev-add_dev_errp_probe-v3-2-51bb229edd79@analog.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Thu, 2024-06-06 at 13:17 +0300, Andy Shevchenko wrote: > On Thu, Jun 06, 2024 at 09:22:38AM +0200, Nuno Sa wrote: > > Use dev_err_probe() (and variants) in the probe() path. While at it, ma= de > > some simple improvements: > > =C2=A0* Explicitly included the err.h and errno.h headers; > > =C2=A0* Removed some unnecessary line breaks; > > =C2=A0* Removed a redundant 'else'; > > =C2=A0* Added some missing \n to prink. >=20 > ... >=20 > > - if (ret) { > > + if (ret) > > =C2=A0 /* > > =C2=A0 * This would be catched later but we can just > > return > > =C2=A0 * the error right away. > > =C2=A0 */ > > - dev_err(&st->spi->dev, "Property reg must be > > given\n"); > > - return ERR_PTR(ret); > > - } > > + return dev_err_ptr_probe(&st->spi->dev, ret, > > + "Property reg must be > > given\n"); >=20 > Even if it becomes a one line of code, it's still a multiline branch, due= to > comment. I think {} is better to be there. What does checkpatch say about > this? Checkpatch is fine about it... >=20 >=20 > ... >=20 > > + return dev_err_ptr_probe(&st->spi->dev, -EINVAL, >=20 > You can make all these lines shorter by using >=20 > struct device *dev =3D &st->spi->dev; // or analogue >=20 > at the top of the function. >=20 Well, I had that in v2 (making the whole driver coherent with the local str= uct device helper but you kind of "complained" for a precursor patch (on a devm_kzalloc() call). So basically I deferred that change for a follow up p= atch. - Nuno S=C3=A1 >=20