From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDA04C433DF for ; Wed, 26 Aug 2020 10:22:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC60D20866 for ; Wed, 26 Aug 2020 10:22:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728413AbgHZKWb (ORCPT ); Wed, 26 Aug 2020 06:22:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:58344 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728106AbgHZKWb (ORCPT ); Wed, 26 Aug 2020 06:22:31 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 22BA1B77F; Wed, 26 Aug 2020 10:23:01 +0000 (UTC) Date: Wed, 26 Aug 2020 12:22:28 +0200 Message-ID: From: Takashi Iwai To: Mark Brown Cc: Pierre-Louis Bossart , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, vkoul@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Bard liao , Rander Wang , Ranjani Sridharan , Hui Wang , Guennadi Liakhovetski , Kai Vehmanen , "Rafael J. Wysocki" Subject: Re: [PATCH 1/4] regmap: sdw: move to -EOPNOTSUPP In-Reply-To: <20200826101301.GB4965@sirena.org.uk> References: <20200825171656.75836-2-pierre-louis.bossart@linux.intel.com> <20200825214858.GK5379@sirena.org.uk> <6f7e5830-4dd8-1ecc-20c3-df75bc9ef265@linux.intel.com> <20200826095600.GA4965@sirena.org.uk> <20200826101301.GB4965@sirena.org.uk> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 Aug 2020 12:13:01 +0200, Mark Brown wrote: > > On Wed, Aug 26, 2020 at 12:09:28PM +0200, Takashi Iwai wrote: > > Mark Brown wrote: > > > > checkpatch is broken. > > > Heh, I'm not objecting it :) > > > OTOH, it's also true that ENOTSUPP is no good error code if returned > > to user-space. Unfortunately many codes (including what I wrote) use > > this code mistakenly, and they can't be changed any longer... > > It's also used internally in various places without being returned to > userspace, that's what's going on here - the regmap core has some > specific checks for -ENOTSUPP. Sure, for such an internal usage any code can be used. The question is a case like this -- where the return code might be carried to outside. Though, looking through the grep output, all callers simply return -EINVAL for any errors, so it doesn't matter much for now. BTW, there are a few callers of devm_regmap_init_sdw() checking the return value with NULL. This will crash as the function returns the error pointer, and they must be checked with IS_ERR() instead. Takashi