Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3729imu; Wed, 2 Jan 2019 12:48:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Xzo7EhOsNsi7MD6axKN5uGpcpfOGjbYC84q7Whk8gQUzIVZU6QmKkfvwmQURPxMy6oN7g X-Received: by 2002:a63:7418:: with SMTP id p24mr14888258pgc.196.1546462109369; Wed, 02 Jan 2019 12:48:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546462109; cv=none; d=google.com; s=arc-20160816; b=kdyveb5F/BRd6kdK8XDCrWZdDjCEh/Pkd1DdbA7fj0hvGiVg+2PZTEUsaQXbzg5dpy M9mpG3solmF3w+///UrwbPlV0OrtLGZ9EwUjQDvKl0AndUTmEEn86NBssS5dDjbvVluu cusVpNYNU/2fdaiwcooc85BzU66RPKbxt04qZ9cbhjOcQ5Y7lQ18ntiw91hZgnLjUY/k oRYaBHTWA/WtSDJhp4DQlQLO51ZfBkTWvZhxiMsVJiSZP4oheRC/fZEryTrsY9MorCr9 VDFW6urZ7dVQNRtmg+vxl3ScRaEDuN3bShjigva2NIsEQHSyELNFN89Cp7pKyY66NGk3 +Szg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:references:user-agent :from:in-reply-to:to:cc:subject:content-transfer-encoding :mime-version:dkim-signature; bh=4BX045HuqzZQyLnghk5iaBiLMxe1Qq6U3uS4PB9/uLg=; b=vRum0jsl4jy1o1XhAI1Mm+6etiwOihoj4xAqBnh6skZknGGOYD1H6RADckUNdeTzTL N1UdcLmzieHslpJe9HqPNdJcdQBN+rRHSQo0LJbnUtfdK3cVS+YYuQAvpyMRpfhJ1pOL Hjf2Ipbu9SoO8CgUqFK0dzCFwhsFXCml5IhgnALGhNTVfnH8bhbiWZK2HzVesnceN/XZ miWGulIVRhnCo2ZfXhvEmtfhwEEnYGf4CdcEfuMyfQKFpjPr5Uj5BFlcWJiIkll1HNk6 dZphPhlStF28aYSHtYmdvBD8XCHG16bOm/NRsYeSlo1bLgBefHBjKLE2WiN6Ps7jpmQy /dSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PFt7daVN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 191si50189571pgf.41.2019.01.02.12.47.56; Wed, 02 Jan 2019 12:48:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PFt7daVN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727645AbfABSSC (ORCPT + 99 others); Wed, 2 Jan 2019 13:18:02 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:44112 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726609AbfABSSB (ORCPT ); Wed, 2 Jan 2019 13:18:01 -0500 Received: by mail-pg1-f193.google.com with SMTP id t13so14884762pgr.11 for ; Wed, 02 Jan 2019 10:18:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:subject:cc:to:in-reply-to :from:user-agent:references:message-id:date; bh=4BX045HuqzZQyLnghk5iaBiLMxe1Qq6U3uS4PB9/uLg=; b=PFt7daVNho4cL+SGAaJnt6xRclJEymy7RG1WUL+d3dyiTbMU0otgop2rC4MQffKGrA XG7N3vNiUXJ62b6+G+UUR6BxKSnXYO7A+l3Wv942x7lDb2iWUOD8TrzG9BxMHObIH4Ya k0qgzHq0RFyCveyIdYrgQigxU18J5xcJ6A7TM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding:subject :cc:to:in-reply-to:from:user-agent:references:message-id:date; bh=4BX045HuqzZQyLnghk5iaBiLMxe1Qq6U3uS4PB9/uLg=; b=POwoA+5jeMtR9PeQSxUY2D4K+UiyxLxQfLd9QXX9LjSDxNnm7eVog9/LfOFQn0m3aQ fSlFkcZZir2zZXMM5rdlfdFItVUZ8nNtjee2eBpTsU97wf4WC+OXtDhhpGINeApzQgNQ NGdzW8yCYFib0dxf9nOxq91ytew309JPz3Hqg0s33nxR4sFTMLhi7GQzG16J7zfjoJzx MvUmLjucwXMPv0TAgUmyLwaGmjkfyTksNzUyB+v1s5/2KIOyOE5wuY7wfPt7jUCbsQdy XjXYDqln9XXCQOHRr5t1zaNgU543kR6Hk3mGNsIUppuXrEcXTO8/1QtXIakpKgNfNKef aIRA== X-Gm-Message-State: AA+aEWZPz6tOiWDthTkJuG8gU2p0eV7wL1coCMuKQz4QRXzoyknVdBVt AP6OXTI5mHCGm2ChA3Ev/rLpeA== X-Received: by 2002:a62:6799:: with SMTP id t25mr45307411pfj.139.1546453080499; Wed, 02 Jan 2019 10:18:00 -0800 (PST) Received: from localhost ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id n73sm86997017pfj.148.2019.01.02.10.17.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 Jan 2019 10:17:59 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v2] driver core: platform: Add an error message to platform_get_irq*() Cc: Rob Herring , Andrzej Hajda , Bartlomiej Zolnierkiewicz , Mark Brown , Greg Kroah-Hartman , Javier Martinez Canillas , linux-arm Mailing List , Linux Kernel Mailing List , Russell King - ARM Linux , Marek Szyprowski , "Rafael J. Wysocki" To: Andy Shevchenko In-Reply-To: From: Stephen Boyd User-Agent: alot/0.8 References: <20181228215620.120672-1-swboyd@chromium.org> Message-ID: <154645307874.15366.9874268705850757907@swboyd.mtv.corp.google.com> Date: Wed, 02 Jan 2019 10:17:58 -0800 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Andy Shevchenko (2018-12-30 02:42:39) > On Fri, Dec 28, 2018 at 11:56 PM Stephen Boyd wrote: > > > > A grep of the kernel shows that many drivers print an error message if > > they fail to get the irq they're looking for. Furthermore, those drivers > > all decide to print the device name, or not, and the irq they were > > requesting, or not, etc. Let's consolidate all these error messages into > > the API itself, allowing us to get rid of the error messages in each > > driver. >=20 > > +static int __platform_get_irq(struct platform_device *dev, unsigned in= t num, bool warn) > > { >=20 > > +error: > > + if (warn) > > + dev_err(&dev->dev, "IRQ index %u not found\n", num); > > + > > + return ret; > > +} > > + > > +/** > > + * platform_get_irq - get an IRQ for a device > > + * @dev: platform device > > + * @num: IRQ number index > > + */ > > +int platform_get_irq(struct platform_device *dev, unsigned int num) > > +{ > > + return __platform_get_irq(dev, num, true); >=20 > Hmm... Why not just do > int ret =3D __plaform_get_irq(); > if (ret) > dev_err(); > return ret; >=20 > instead of big refactoring of platform_get_irq()? Sure. Thanks for the suggestion. But we need to check for ret < 0 I suppose so that we don't print an error message for all the irq numbers. I'll send the updated patch as a v3.