Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8686034rwi; Tue, 25 Oct 2022 09:33:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6TnYodjowjXTtC/s7ySVQQiN0rw3hCVr/BOHkIT+nvhvZif7r+Gsf16pUIOB06ufLXvsvq X-Received: by 2002:a17:906:4fcd:b0:78d:4b28:9d57 with SMTP id i13-20020a1709064fcd00b0078d4b289d57mr32870195ejw.303.1666715619128; Tue, 25 Oct 2022 09:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666715619; cv=none; d=google.com; s=arc-20160816; b=Bd9S9sl1VM0/dNLGx4t+vnH8Y8ULt1pg9j/97GJEstRuwKoKqBz39yqgidb3Ishvl6 7PUHFiQsuo7i8StscexLNJv6GiNdLKHWow5eFzzjVB3CmMcEUZxwktHYYKoo0Gfe9sZh aq3z1r8aWz6MqNNV6Lgz6ggjAc6xAPolgu8budVDnkek1+ccx3fb/4kt6zSd6liA8Byi iSwO7dSCnyLvReEAyb/HJ4a/DXTym710qPLYaFTBlFsSJD+ew6p/mSVIlKgpXovEo4TN cgIxUZMzYaGQeU8Kxrh8n7kVsFPLFKOjH7dWIVrpuA29AT2EHVtKV0SoT6qJD/lju6HU d90Q== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Wik/O/yrEN4/XAcRItT9sUsHMjkejeytWu90EfGnl2Y=; b=TqcY/b36/jU1hYSk7FVBdaZBVXJfgI0amZPYM5LQ9enWTArZNcTodXmXYusMi2wQPQ YnmvdfLbFa4NhlXINWna5df4QWRgm5CM9oNMCC6WlhsdDl5lC6ZSCAqnCT6DKSeibnPu XVqzrkShTjDhGqfxscBfQofbhRciR/cL+/DxgMyYfzTjyJukV5teUWLBh1A0alPOeWCe sa+s6xOoI//SwJc08DN72K63JCV8pu62OI07GHCR6ny9WUsc8xN3K1sZMDwvMILXlgej o8Tj8y4KGpx8mg0zTlFSpXCHitmVf/99xlbEpc2VFrMDneBErezsyjLYTqwd81SyiOH2 d2Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Bn08f7ux; 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 l18-20020a056402029200b00448b88378f8si2784090edv.359.2022.10.25.09.33.14; Tue, 25 Oct 2022 09:33:39 -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=Bn08f7ux; 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 S231656AbiJYQWB (ORCPT + 99 others); Tue, 25 Oct 2022 12:22:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231693AbiJYQV6 (ORCPT ); Tue, 25 Oct 2022 12:21:58 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4513780EA5; Tue, 25 Oct 2022 09:21:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666714917; x=1698250917; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=JIY/0KwS4tqdqoinWPwzk3zy7GThTftpHV5/elSMquw=; b=Bn08f7uxVp4J8F+sc0CO4Uppw6gp1HkYW6f6L/Bl52+17aZXfCyaJPwR a9nTfA9jNoMDH8XdIM7kiS/edrvxDXaGEv1O0YpZWGS4NpOXC+cYKPtxM +tSmaxDq2zcZi7s9oaQVurddRI4HgYQPNq8PlIn8Gd5ohcInI7k8UzkPL e011CTtyR4bumPcSQEH2OxEbOngs86yWh6EUcsjl3HtcMtK6M56JM+8x4 hpp0qFk0KFeSneNWDYhEVgr+eQRvDCKvXKIbO2JgSOEnGFx2BOEZJd5uR DEkgYKvd2RazvqAHESPQ5Qg6S3oHnsJ5afVpap7ymsLWlIBkDAsH6wIU0 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10511"; a="371937328" X-IronPort-AV: E=Sophos;i="5.95,212,1661842800"; d="scan'208";a="371937328" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2022 09:21:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10511"; a="609628147" X-IronPort-AV: E=Sophos;i="5.95,212,1661842800"; d="scan'208";a="609628147" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga006.jf.intel.com with ESMTP; 25 Oct 2022 09:21:37 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1onMgI-00267N-32; Tue, 25 Oct 2022 19:21:34 +0300 Date: Tue, 25 Oct 2022 19:21:34 +0300 From: Andy Shevchenko To: Matti Vaittinen Cc: Matti Vaittinen , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Wolfram Sang , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org Subject: Re: [PATCH v2 1/2] drivers: fwnode: fix fwnode_irq_get_byname() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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, Oct 25, 2022 at 06:11:49PM +0300, Matti Vaittinen wrote: > The fwnode_irq_get_byname() does return 0 upon device-tree IRQ mapping > failure. This is contradicting the function documentation and can > potentially be a source of errors like: > > int probe(...) { > ... > > irq = fwnode_irq_get_byname(); > if (irq <= 0) > return irq; > > ... > } > > Here we do correctly check the return value from fwnode_irq_get_byname() > but the driver probe will now return success. (There was already one > such user in-tree). > > Change the fwnode_irq_get_byname() to work as documented and according to > the common convention and abd always return a negative errno upon failure. and abd ? ... > + ret = fwnode_irq_get(fwnode, index); > + /* We treat mapping errors as invalid case */ > + if (ret == 0) > + return -EINVAL; > + > + return ret; This looks good. -- With Best Regards, Andy Shevchenko