Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751697AbdGZK0d (ORCPT ); Wed, 26 Jul 2017 06:26:33 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:38530 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751175AbdGZK0b (ORCPT ); Wed, 26 Jul 2017 06:26:31 -0400 MIME-Version: 1.0 In-Reply-To: <20170726082304.7j4lbvsuyyu7owqy@dell> References: <1500506426-3047-1-git-send-email-rajmohan.mani@intel.com> <1500506426-3047-2-git-send-email-rajmohan.mani@intel.com> <20170720090300.ayx5pz5l4yntefpt@dell> <6F87890CF0F5204F892DEA1EF0D77A59725DD60A@FMSMSX114.amr.corp.intel.com> <20170725091012.3hpxihekht2j35xb@dell> <20170726082304.7j4lbvsuyyu7owqy@dell> From: Andy Shevchenko Date: Wed, 26 Jul 2017 13:26:30 +0300 Message-ID: Subject: Re: [PATCH v4 1/3] mfd: Add new mfd device TPS68470 To: Lee Jones Cc: "Mani, Rajmohan" , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "linux-acpi@vger.kernel.org" , Linus Walleij , Alexandre Courbot , "Rafael J. Wysocki" , Len Brown , "sakari.ailus@linux.intel.com" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1067 Lines: 30 On Wed, Jul 26, 2017 at 11:23 AM, Lee Jones wrote: > On Tue, 25 Jul 2017, Andy Shevchenko wrote: >> On Tue, Jul 25, 2017 at 12:10 PM, Lee Jones wrote: >> I briefly checked few ->read() and ->write() implementations and >> didn't find any evidence of positive numbers that can be returned. >> Documentation (kernel doc) doesn't shed a light on that. So, to me it >> sounds unspecified. >> >> So, for now (until documentation will be fixed) I would rely on >> if (ret < 0) > > It's not unspecified. The regmap methods call into regcache_write(), > where the kerneldoc is clear. drivers/base/regmap/regcache.c:266 " * Return a negative value on failure, 0 on success." I can hardly find this any cleaner than "unspecified". > Perhaps we can also change the regmap > kerneldoc headers too to match, which might lessen the disparity. I'm not familiar with the guts of regmap API, so, I would stick with if (ret < 0) for now until documentation specifies positive return values. -- With Best Regards, Andy Shevchenko