Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9680272imu; Sun, 30 Dec 2018 02:45:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN6sr78GEwtaca6j0repsfsX7r5vAfHuPTqyO92haM26b4t6ee8b85tVoVRp3GVCTKaiNMA6 X-Received: by 2002:a17:902:9887:: with SMTP id s7mr32956996plp.199.1546166725792; Sun, 30 Dec 2018 02:45:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546166725; cv=none; d=google.com; s=arc-20160816; b=YpbO1t+JH5z80TQ4Axc1m5/sUvqdXgwEOp+shWiCjeZvy/Lwbws54ilWDbLepxTnKe TZrl/Ecd2swEJhyvrHKdZmWKFmdG1f9ZE+F3PKpwZ92xEqeFUDzUNfpwdQeG/QjDsJPE Rnb6FOytFi+ktGspE8cKm1fc4rVSj5ljDTmG2NoWsEC7kzjvCkrljME+EFf90JsRdG5C PvAXKlCBfxPxSl3ThXEGenTNe7ub+dgzdg1u6djQTCfD+bGw9ULj3LmeDE6SsdEErbRa QGI7nTs0uu8pZ/K6Tj8/qXVu2vIq95Tp8JDSS5JO6lx5bQZqRH3IR9NS2D0kNN2rvy3P EPag== 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:dkim-signature; bh=0XgghK1nd2s2qo2RWUpMVObrnXaajFF0lB8CRb1jtwQ=; b=eu1k0KxajSHp8CoQuXs9HGr4DteghEoAXocRjKcRBm9PAnE27voGwuUWaxeTMBsB2r 1XvFs8no96bMHj5mqW65TfY0z3y+RebjfmAxZEvkJ/bQhDJbARR6OfvWywSZ+Xt+no8U 1GBli9CHmA6gu9f/rh4eCojqSJO/AMsInn375Fg2BZkqsSbyLOxFiO1j1R9Tom+/AuN1 232C/99kB47Aw/G0qpg+B1BvY6/tI7waVsDlyHbzv8Z6Pg210nCK5mBrpGUVVDog/Ptc vwcd1CrhR/4UJrhHPqwCnhNt1nEBUl8UsTvcjdlkqhXPFY4ZI0jIpDjbbpdxpVOV66mC Yd5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gy1v4zbX; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 10si41823763pgl.30.2018.12.30.02.45.10; Sun, 30 Dec 2018 02:45:25 -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=@gmail.com header.s=20161025 header.b=gy1v4zbX; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726198AbeL3Kmx (ORCPT + 99 others); Sun, 30 Dec 2018 05:42:53 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:39101 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbeL3Kmw (ORCPT ); Sun, 30 Dec 2018 05:42:52 -0500 Received: by mail-pg1-f194.google.com with SMTP id w6so11765463pgl.6 for ; Sun, 30 Dec 2018 02:42:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0XgghK1nd2s2qo2RWUpMVObrnXaajFF0lB8CRb1jtwQ=; b=gy1v4zbXScgnaff6he+BmRb6STOERDK/cAPglgOxhXuNBOvl8kqC+X/Dm7XmRyxiTY O9VJJOT0UdKQs3hGQkLkZrgBixCafhvYWSumrValDFYqNkJhCTMLFkGJ8DhvT892CbG1 0L+uLsDNhwaLuharBcklhagccgk37Qc8gmWyM68ugr7RNxDex6GvrEc/KkTuV3q9b59M w9ZKK9sS95N2IqA2Ew+jlnWOyhBiuApGOCPVaMJAEPp6xXpvo8wFOGpbKshNOmaEvVhW IFoTcPYe4J+5+cDuWJRtgLqNx880nHFAZnODtsWV46NDQJC/6DD6JeW8aEcxVqP+d9PH S1KQ== 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=0XgghK1nd2s2qo2RWUpMVObrnXaajFF0lB8CRb1jtwQ=; b=aaEahHyFxhO/da16b6lOdRXjMtc2z5xSeCNkt4gJgcOHGpLYvyauGEI3oNpNC1zof0 QW4g17UwQR1fwMCouf3gzYNRcV4KU+MB4gSJM5IjGe3HyJnPvyOlDTvvt4ySnbWTVuWV dpb3kCyOgGGnOBuNrPGZsNgtvhV1CEcWFTdEYG6PEwW/Z+wwyicEUMkf8U17k42HOK6m /W7QpQiyd68b27vGetlyqaPXpIfRgWuve23uBE2vKXxzzTP39rYIOh+cf/t6q1TYKXHA 1FASa2jFjPeeGbEXfABrUS/Jrxvk/3NBV5GU49jEYGqzp/YmZli9syBrXRMl8kXRNGXB 488g== X-Gm-Message-State: AJcUukeRuy3x9/CI8LbGx88AC3QjAC580+SVFHmyri9agfOfby3iIp16 NaD2qyMVsOajPIHi0sIZMEYEjVwRSGBHLtr0jtg= X-Received: by 2002:a63:fe0a:: with SMTP id p10mr4125571pgh.265.1546166571329; Sun, 30 Dec 2018 02:42:51 -0800 (PST) MIME-Version: 1.0 References: <20181228215620.120672-1-swboyd@chromium.org> In-Reply-To: <20181228215620.120672-1-swboyd@chromium.org> From: Andy Shevchenko Date: Sun, 30 Dec 2018 12:42:39 +0200 Message-ID: Subject: Re: [PATCH v2] driver core: platform: Add an error message to platform_get_irq*() To: Stephen Boyd 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" 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 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. > +static int __platform_get_irq(struct platform_device *dev, unsigned int num, bool warn) > { > +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); Hmm... Why not just do int ret = __plaform_get_irq(); if (ret) dev_err(); return ret; instead of big refactoring of platform_get_irq()? > } -- With Best Regards, Andy Shevchenko