Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2615053rwd; Wed, 14 Jun 2023 05:26:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7RBo2JSJ7I53vWIKWAHOsjRk4VgqqdV55WntK980Dd4yTL9UibHNJn97KR2nsozFiBiKTI X-Received: by 2002:a17:902:9b8c:b0:1af:adc6:3bc0 with SMTP id y12-20020a1709029b8c00b001afadc63bc0mr11116523plp.5.1686745574693; Wed, 14 Jun 2023 05:26:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686745574; cv=none; d=google.com; s=arc-20160816; b=EjkHDcwYDptj1fx4XZElWVHFZvrZvrZPQ4wtVVZlXyK69A1C2OJrvUo3HW8t6tnVyq ZMya2Flxj9/CpbEjLwdYD4E6doGaSChB8VM3o6VmaE9kZAg/rKoZnEbEQIPOGqX8/wat Y2ExpV11eCI5UnY3SxMOFM+4ptQt7ve4vnxXPtsyHQaNXZ8xNvEFn89L2d3sRrQxKTWh krEB6lAn4DWjjPez6dIzTsLaFGL64OgtpJYSghFQjBiGHTO0sMC+51a5fpZWSMppjE+V qiM0WHJF4k/gxSqGX0BnTFJ0X+a0vXaeiQeRRYN1zJmTe9WJnYOOkquriMzPQe/rFyj9 CD6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rJjFNet3i9ZDIFP2JDu3ZahVUEuBK9wyUaVSfvQvKtI=; b=QUHC8qtg/BFi4hI1XjzOlT7cQnZm1o415Zc2nIwpNbCNMFTOwS83NC6iQyH2pe/0Y9 vma/TWIb1D8LSlZB01F2pDswE+7dcySo4EsPHxUXF1J9eWiGa0B3QwL21pifuOOrLBmj tWiy1nenFx7vF/wmUPJ7MBfc8wMNPV1fpC1VI5lYsqq4KRznkbj2CfxDURDt9knp234F ktProo+rk/C3qV6hGq4R5l5iNUxDkBITyzgCXjOjcgGRAY79y5ngxYAXYQZOho6L72KS SFbdVbLV6cRDw49hwmEsm5mcCzlvkPu6FoZ7/kXKiCcGd1wET20r5erSmc5gFUvJmoDY EU5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TQprOryB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kk6-20020a170903070600b0019c354055d0si10422323plb.304.2023.06.14.05.26.01; Wed, 14 Jun 2023 05:26:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TQprOryB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244038AbjFNMQf (ORCPT + 99 others); Wed, 14 Jun 2023 08:16:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243985AbjFNMQc (ORCPT ); Wed, 14 Jun 2023 08:16:32 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 637101FC7; Wed, 14 Jun 2023 05:16:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686744986; x=1718280986; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=lXIww3R8oE2mnyCB8FLd9dnkhHpRmtz39UaDyJ0b2qg=; b=TQprOryB+Pv0WoXnwGcCEl2qeATqJjB8R19g54lS540APOs3qMOraWxP p8hqMPKPxBKbfo+pM/pDfGxCqncCwproO2WMrS/VLVOl0R5Q3Rvj84cqi 6aejFxtKT07pX6yeQrCIXizdMiJS0dnYsPWVt5b0OYdDREAdYTavLCPf0 JMU8AOQKrB8d4nV8XaDnWm6vysEujJ5v+YgLygg/RK0sc3sQ+BBRhK/W4 inBYYKqd9Au0wAz0IZ/Tpn6cDqz8JfJF8leXfUem5EHrwN9Ww6A8kTe9V NVqHVeKjvC+AGfKZJzfioUnIczcAx6HphmEwox99lQ1D1VEMwCLv8Jtpf A==; X-IronPort-AV: E=McAfee;i="6600,9927,10741"; a="348256688" X-IronPort-AV: E=Sophos;i="6.00,242,1681196400"; d="scan'208";a="348256688" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2023 05:16:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10741"; a="715176844" X-IronPort-AV: E=Sophos;i="6.00,242,1681196400"; d="scan'208";a="715176844" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga007.fm.intel.com with ESMTP; 14 Jun 2023 05:16:15 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1q9PQ6-003hE7-0y; Wed, 14 Jun 2023 15:16:14 +0300 Date: Wed, 14 Jun 2023 15:16:14 +0300 From: Andy Shevchenko To: Alexandre Belloni Cc: Rasmus Villemoes , Alessandro Zummo , devicetree@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 5/8] rtc: isl12022: implement RTC_VL_READ ioctl Message-ID: References: <20230612113059.247275-1-linux@rasmusvillemoes.dk> <20230613130011.305589-1-linux@rasmusvillemoes.dk> <20230613130011.305589-6-linux@rasmusvillemoes.dk> <20230613212651c8770218@mail.local> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230613212651c8770218@mail.local> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 13, 2023 at 11:26:51PM +0200, Alexandre Belloni wrote: > On 13/06/2023 18:20:56+0300, Andy Shevchenko wrote: > > On Tue, Jun 13, 2023 at 03:00:07PM +0200, Rasmus Villemoes wrote: ... > > > + ret = regmap_read(regmap, ISL12022_REG_SR, &val); > > > + if (ret < 0) > > > > I always feel uneasy with ' < 0' — Does positive error makes sense? > > Is it even possible? OTOH if the entire driver uses this idiom... > > oh well, let's make it consistent. > > /** > * regmap_read() - Read a value from a single register > * > * @map: Register map to read from > * @reg: Register to be read from > * @val: Pointer to store read value > * > * A value of zero will be returned on success, a negative errno will > * be returned in error cases. > */ I'm not sure what you meant by this. Yes, I know that there is no possibility that regmap API returns positive value. Do you mean that regmap API documentation is unclear? > > > + return ret; -- With Best Regards, Andy Shevchenko