Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp128810imu; Thu, 3 Jan 2019 15:39:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN59YA+QlYy4cD2Mp4Kg8wQPYGyFNiu5ENvyIBApZ+exs4pLOoAoynKng9fFDYgZuof866SP X-Received: by 2002:a65:40c5:: with SMTP id u5mr18195010pgp.46.1546558789712; Thu, 03 Jan 2019 15:39:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546558789; cv=none; d=google.com; s=arc-20160816; b=L1ks9zbSFN5LC0QM66DYnA0AAoDaU6DkVK8nCF2YOmh2yePPXmMxvRBYJDB6Fj41HF NW8/DhGx9VDm4RBTV0cAxPRIVxjvsp4g3FgCQ4LDOS7yaqj9LIjlQlpbGIcqlEbri8yG 3BBkb3TtlzYR6Q5AmPwibG2C6+IxtptbL5FX/+LZFh2HRYJwtBWTIl6ZQi51lGLvZKP6 LvHdvzm03vr1Timku9FEPPCgvXqwTH6oY9Z/uhzdMpU7i1H4grf5ckB2wGZ1PfI01O76 qLbPscZaUYoBMxNHtz+h2FauLpW6BjDPKbj0WfnHaUFdSiESveVz0nmMnGg3jjwfYhKM 5aew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=d+Algh/Ysyc2qh0ZVeiaQBZGmFP+zB1c7uxH2nEn/v4=; b=u1uerTWAIOWbVEASV38BhlRWN51cGc5eLivk/WeqL5UJZkUxVBUa+GgRWZEbRbzaiQ w1JPjUC+eM92sx2SKEPJYgJXWuqzEwp0t7FbPOOCA18gAL+EZAAz3vXzmUS492Pby7/r ONDaUc96hErf4cBAXpdBIftevVtDepkpVxgWQRAewmoxSUslE+LYieBh7NvrGVAw5u7B yGqKkI66ZcdbYSFexSNXFIw/L3bkCx07j6MXjXgm7MSoK62whJNph19tZwtRmfDvwvUO IJtX4eei8O75zjyiEhimvZFJUWIKhXm11+/ywOQbyRYwstwoZpJ+rbsAYRYOFd7ZfrTA paqg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si52326747pgf.453.2019.01.03.15.39.34; Thu, 03 Jan 2019 15:39:49 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732586AbfACRXL (ORCPT + 99 others); Thu, 3 Jan 2019 12:23:11 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:41408 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730229AbfACRXI (ORCPT ); Thu, 3 Jan 2019 12:23:08 -0500 Received: by mail-ot1-f67.google.com with SMTP id u16so29957618otk.8 for ; Thu, 03 Jan 2019 09:23:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=d+Algh/Ysyc2qh0ZVeiaQBZGmFP+zB1c7uxH2nEn/v4=; b=hT9yHTgY/LFzvYQbbuzbQu4ETXfDT/8UF4enthB+9UXZXwOHpTN1aj7QqTYQXyaPwm Btb+DJFMVFyOdQlu3Co4SyVLdl5gCCS7YbNcukfNWKskJ/Ad3WqRl4yO8EVuBicjEX6/ qFvIFcRlzNZfOQsV9z3JHrcXnncE/+aiB1qW6iN60sglQc5S9WSArFdVEJEUzFmI6DsN cXciZr5dzf+yfaHG8aMKB7rx49TO+s0YFhxc1AUtF8fhqdL2ORkSwXikjBN96Oke8xu9 f5jo2UqDHvF6Sc4r7bkeph2AgFo8K8zyC9vWHPACYNbHhrPstapvGXJlPbIZk+vAIlOa ywiA== X-Gm-Message-State: AJcUukdeENBHxX4kXiGWRF7jbVzuBUhGBskcQMlQyRCqEAw+jGRuNOsY YGrKogB7uNmudK7Dcfza5OTJJCCA2oHEJ2yvpX4= X-Received: by 2002:a9d:60b:: with SMTP id 11mr32154029otn.200.1546536188072; Thu, 03 Jan 2019 09:23:08 -0800 (PST) MIME-Version: 1.0 References: <20190102185106.56913-1-swboyd@chromium.org> <154653191998.15366.14229484132412159772@swboyd.mtv.corp.google.com> In-Reply-To: <154653191998.15366.14229484132412159772@swboyd.mtv.corp.google.com> From: "Rafael J. Wysocki" Date: Thu, 3 Jan 2019 18:22:56 +0100 Message-ID: Subject: Re: [PATCH v3] driver core: platform: Add an error message to platform_get_irq*() To: Stephen Boyd Cc: "Rafael J. Wysocki" , Rob Herring , Andrzej Hajda , Andy Shevchenko , Bartlomiej Zolnierkiewicz , Mark Brown , Greg Kroah-Hartman , javierm@redhat.com, Linux ARM , Linux Kernel Mailing List , Russell King - ARM Linux , Marek Szyprowski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 3, 2019 at 5:12 PM Stephen Boyd wrote: > > Quoting Rafael J. Wysocki (2019-01-03 01:40:26) > > On Wed, Jan 2, 2019 at 7:51 PM Stephen Boyd wrote: > > > @@ -130,6 +125,22 @@ int platform_get_irq(struct platform_device *dev, unsigned int num) > > > return r ? r->start : -ENXIO; > > > #endif > > > } > > > + > > > +/** > > > + * 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) > > > +{ > > > + int ret; > > > + > > > + ret = __platform_get_irq(dev, num); > > > + if (ret < 0 && ret != -EPROBE_DEFER) > > > + dev_err(&dev->dev, "IRQ index %u not found\n", num); > > > > Why don't you log the error code too? > > > > I don't see much benefit to seeing -ENXIO or -EINVAL printed here, so I > left out the error code. OK, so the value of the message is to tell the user that some driver asked for an invalid IRQ, right?