Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp403977lqt; Thu, 6 Jun 2024 07:07:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW71WCCzxVQ/5bp3V3i7mFne4jJ+CozF/h3u0HnE4/A21t4uuNGwUjyPztG/BxJWIRJZ/78et9fY54owZ3hSazSUvCJhacvL76+WLhtBQ== X-Google-Smtp-Source: AGHT+IGF4NK5+o+H+psjIJBSxYBj7DepE0IJnCOOVSXzyL10thNWfi2v6Asn/a9UD2y2b/sCpqeg X-Received: by 2002:a17:906:b852:b0:a68:b49e:4745 with SMTP id a640c23a62f3a-a69a0266a6bmr357505066b.70.1717682873229; Thu, 06 Jun 2024 07:07:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717682873; cv=pass; d=google.com; s=arc-20160816; b=ERnQID+vTNRYndGwlLe759/Hj2dBOsnjGijE9MeCB3LtkVUf8+h3YYTMcfVQrBXUyB scwhKv9WO7qLMuE4m2GoqvjQz1UmklHcyLoqlfLAQKScghnH79pxvt/C07fphusA0SoR Qcrwt0/vAVke1ucw+gWCkQSPdm8xLMijvP4tDcsFGivmkeHNoJmEkG7ZGyibMp2pC6CN UBoukgHUAY/7a3gAlpx6l8bOCeGn+uL0RnPFNDv/43vZHttJclVne/30V0AOdH1xuuVq g+N+CVd0e/x+opnbPLFvfOtZgHQ6RbW4JXL42EZwWmHZ0NSAay6V09aqqEsgnyMY+WFJ 8mdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=4fVuP8/pF62OAAEoKS/4y6At0NMar7AicLxJ7GuE7cM=; fh=k97SJSh1DOAJJZt2mKeW685WmtNYtGOqJqI7efHzJNE=; b=NoNiNkrvtqAR3wHEIQunFzLGd492/6h5QvrqnoVjCRmLi3Y/EvuzzIXLrfb/2mT4tr 7sqiOjjK+nSUxz19B/HUfyvgPkSCSlV91vtz87sCAUZQB++uiQQZfly+asut5o1gSKnf jd60M77ZME0sY1b5NosezoGH3Reps0MpxaYjkxBYEf1yvr8CkoFpUAjUWzSIpdwyWN6l MYWc3dM9yzRnOxh7v/sdT/3no5QnqFIdw+HiOy5iX4zLwnP2kIcLLD7HnSEUTD75tiZH 7ashZLTAeiSqB+jj8ujwMlthfX1q5i9vcBLm1K+Ejbai1M5NP8kiEeFZiYDaNNJtLHdF FVhw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="UiyYus/d"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-204096-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204096-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c8072814asi73947566b.787.2024.06.06.07.07.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:07:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204096-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="UiyYus/d"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-204096-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204096-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 738F11F25CF2 for ; Thu, 6 Jun 2024 10:18:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 596BE194C9E; Thu, 6 Jun 2024 10:17:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UiyYus/d" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 110B8194C70; Thu, 6 Jun 2024 10:17:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717669067; cv=none; b=bXck0rA//It1ShO0jz5BS9gAwd2ljpjOx2V2zu/CJuC3h9u8FVmxrJEJ/CkRPtB440tfxXiS2L5uUYT0t+uukQ92Vvt3wB7hV5F89f3FW33OLWUjr9s1+j3LSKDS/hJ6mm6MBFzRdw6ucbXRKjAY6sP/9Sy+BhkVd7H1KdzN6l8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717669067; c=relaxed/simple; bh=izQg9vdBQ3XHJ+BM/CW9WhLY3IAzyIj2Vi9Wn6+3sKA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DCAINWIAYWzB43Nfxl4rOX0WYlraD5GZZVPzqbqUcpMc3cGWs3VwYN5gM2kKbBA16F67xnBIJzHIhB/fyyx9V249/Sga7rm6J4iJBupLDNenN9dStPKARcl5l64iYzXAisDB07l3T5MvZPkezGy07YT9kwRhXzh7Ve8qZHx6uDA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=UiyYus/d; arc=none smtp.client-ip=192.198.163.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717669066; x=1749205066; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=izQg9vdBQ3XHJ+BM/CW9WhLY3IAzyIj2Vi9Wn6+3sKA=; b=UiyYus/dCpbzaiW6z/TQi4yq5dKehwHd4BopldaZAmwEnvLoArcevq8l qOTtZ5e0xWtSNJaLlmusxts5Wa7jxaAn9Scy3XpPswN03BmRz7BI/vYfz NSbEDxf9I+xB5rW207+W4nGp6x3d29ioaJ6uVERoDhi82i1qMRsNYN9nn NcQYEBkWgMT6wsh8gD3KTwmX7gu/DeRl2CFUDBHi25QSPa4x165//K7ms IZcbtPqlbWtAqkkau+eTvFqinV+JEpVAM+ds9/zNpcrafce6kPiHzRLiB d/pyekLDXv0iWeBBbpxcoscfQfyUFbTRk/VhSAeWObho6VqVmyen7Fmj0 Q==; X-CSE-ConnectionGUID: Xwh2F62+SCS9h5C1RW6ueg== X-CSE-MsgGUID: 8U2WxuKbSnGbi1Vggzo5dQ== X-IronPort-AV: E=McAfee;i="6600,9927,11094"; a="14130021" X-IronPort-AV: E=Sophos;i="6.08,218,1712646000"; d="scan'208";a="14130021" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2024 03:17:45 -0700 X-CSE-ConnectionGUID: rltQj9RWSieZBDm9RlCi6w== X-CSE-MsgGUID: iemh3MQ0TOqj84jpUIA+Ow== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,218,1712646000"; d="scan'208";a="37881331" Received: from smile.fi.intel.com ([10.237.72.54]) by fmviesa006.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2024 03:17:42 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1sFABf-0000000E8Fy-2JP4; Thu, 06 Jun 2024 13:17:39 +0300 Date: Thu, 6 Jun 2024 13:17:39 +0300 From: Andy Shevchenko To: 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 Subject: Re: [PATCH v3 2/4] iio: temperature: ltc2983: convert to dev_err_probe() Message-ID: References: <20240606-dev-add_dev_errp_probe-v3-0-51bb229edd79@analog.com> <20240606-dev-add_dev_errp_probe-v3-2-51bb229edd79@analog.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240606-dev-add_dev_errp_probe-v3-2-51bb229edd79@analog.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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, made > some simple improvements: > * Explicitly included the err.h and errno.h headers; > * Removed some unnecessary line breaks; > * Removed a redundant 'else'; > * Added some missing \n to prink. ... > - if (ret) { > + if (ret) > /* > * This would be catched later but we can just return > * the error right away. > */ > - 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"); 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? ... > + return dev_err_ptr_probe(&st->spi->dev, -EINVAL, You can make all these lines shorter by using struct device *dev = &st->spi->dev; // or analogue at the top of the function. > + "Invalid chann:%d for RTD\n", > + sensor->chan); -- With Best Regards, Andy Shevchenko