From patchwork Tue Jul 30 18:15:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11066479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 63A2A174A for ; Tue, 30 Jul 2019 18:20:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58DFF28488 for ; Tue, 30 Jul 2019 18:20:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D0C3287A0; Tue, 30 Jul 2019 18:20:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C674928793 for ; Tue, 30 Jul 2019 18:20:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728839AbfG3SQI (ORCPT ); Tue, 30 Jul 2019 14:16:08 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:47032 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728811AbfG3SQH (ORCPT ); Tue, 30 Jul 2019 14:16:07 -0400 Received: by mail-pg1-f193.google.com with SMTP id k189so11432373pgk.13 for ; Tue, 30 Jul 2019 11:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aSRdspc9UmTVqUtM/LVhQfTdfVvsFdhNYRk7pu3nDM4=; b=LtjcNupM/HRKM4JoaldcQRTyS2bM2yL9wvKeOG/reX4s7oliVrhZ3wp4wzfzbR4jpA A1CKU4sjWJkHVuwwi/hdtmK5ZPXBxh2NJotGUASyjHj8HoyAh2bkC1ois2SudhmvMElY Y3kLvEzuSI7mA8c4hRjPsl+5oO787lm80ulgc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aSRdspc9UmTVqUtM/LVhQfTdfVvsFdhNYRk7pu3nDM4=; b=Iiy9ihvujUpwpbTQnsETMJxmtAtOHWfcZnYuMT2akOiwgmqa7sdkq+cGEhmRRR64ng M+O//wNFbbmvS/9mzs5WzoqUB37rsifI+Iwkm+DjypbCfU3gJz58nUo9wOrrDrFV5hZ1 qLOl74xYsnlSJG04PkpE64XQWEImycww51/elfSmtwgKNd5PvXPNR/8QnwjioUPtNWUo mQyvzQdMNNq/6FSsyuvvm/E9MdOnfA7Vv/8FWh6ZuzhH8aTOOLehAXYKdaz0dhBwq1NJ CwB1HXjISvoO0GGPBFKGg/qN3AjAoJ6R8CEUq9E5/EVxpxTzBQNWr+flDcY/NDPTQQM2 EB2A== X-Gm-Message-State: APjAAAW4G1Lzq/3gwmy0cuACeCNg+mQfWZ7E159iKzJbHMnf3Qz8/sGo WO88A0HTJNSdC3Bh8haRnR1LMw== X-Google-Smtp-Source: APXvYqzl9TiZn1sx5mDRdicXU56NYnmqpjlBsgZoexEMD31JECB2BpobzlnsLFpDz+nGfBgNtl06Yw== X-Received: by 2002:a65:57ca:: with SMTP id q10mr113397707pgr.52.1564510566934; Tue, 30 Jul 2019 11:16:06 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id g1sm106744083pgg.27.2019.07.30.11.16.06 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 30 Jul 2019 11:16:06 -0700 (PDT) From: Stephen Boyd To: linux-kernel@vger.kernel.org Cc: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , linux-pm@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH v6 09/57] devfreq: Remove dev_err() usage after platform_get_irq() Date: Tue, 30 Jul 2019 11:15:09 -0700 Message-Id: <20190730181557.90391-10-swboyd@chromium.org> X-Mailer: git-send-email 2.22.0.709.g102302147b-goog In-Reply-To: <20190730181557.90391-1-swboyd@chromium.org> References: <20190730181557.90391-1-swboyd@chromium.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // While we're here, remove braces on if statements that only have one statement (manually). Cc: MyungJoo Ham Cc: Kyungmin Park Cc: Chanwoo Choi Cc: linux-pm@vger.kernel.org Cc: Greg Kroah-Hartman Signed-off-by: Stephen Boyd Reviewed-by: Chanwoo Choi --- Please apply directly to subsystem trees drivers/devfreq/tegra-devfreq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c index 35c38aad8b4f..ffd17aba7533 100644 --- a/drivers/devfreq/tegra-devfreq.c +++ b/drivers/devfreq/tegra-devfreq.c @@ -674,10 +674,8 @@ static int tegra_devfreq_probe(struct platform_device *pdev) } irq = platform_get_irq(pdev, 0); - if (irq < 0) { - dev_err(&pdev->dev, "Failed to get IRQ: %d\n", irq); + if (irq < 0) return irq; - } platform_set_drvdata(pdev, tegra); From patchwork Tue Jul 30 18:15:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11066449 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3A25213A0 for ; Tue, 30 Jul 2019 18:18:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 301A528488 for ; Tue, 30 Jul 2019 18:18:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 228BB287A0; Tue, 30 Jul 2019 18:18:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8522328488 for ; Tue, 30 Jul 2019 18:18:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388075AbfG3SQf (ORCPT ); Tue, 30 Jul 2019 14:16:35 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:39615 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388067AbfG3SQe (ORCPT ); Tue, 30 Jul 2019 14:16:34 -0400 Received: by mail-pg1-f193.google.com with SMTP id u17so30477070pgi.6 for ; Tue, 30 Jul 2019 11:16:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eK4LqccbexBbFwqN6Jv75UZiA5HD108HkeIAaMcaoSk=; b=EeipzuZUgBBHDP2m+SB0YDxqn3NNwmT9E+BBw37WtV1keN0d+FirRsAehrjHIIdrRu sTo+j3ADlw6xCRXXqiUe7x+YdqidUOQTLwQdf//CvX7cvcvu+MigUapFC3Fb+GikoW9V 7xpLH4IkurfaDjtVNMPl0YG4lXWTXlMLMsN0E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eK4LqccbexBbFwqN6Jv75UZiA5HD108HkeIAaMcaoSk=; b=M6hHNFvQL+gqVfdIiKuVN06prqFcHailUniMrHT8oi6CyNpJ+K0/Ku+XKsgmRcoaqH Lqx2t3NLazsKpo8lKPSGbRJGTf6bXa0ScQgISNnP9WfoBCjPljSeqQuyaRgcSPfecbQU I1UB+m+Sm574qnV1U02vVEs7AuV28YcnAnE5RIcG6KvnK6KD5PsOZmXQQamuESgDGwun qDhg+sy1tBxzAB+83Nm5mR+CUhLUwbaqiAel6FqiReITvfOQ6vARpLhClj90UPMTmWjE JYGVzjzBFVzOvNolnh4VvcIJgVZxEP9c5NF9B36Jvj4QgPR9xXiJxcAtgoI9KDqfBnfl J8sQ== X-Gm-Message-State: APjAAAVRvtKwbLEMc1rTR/98F7hbBF7eLhEMbZWIyMjXKdaT7vogKBEK Wa02GgfYM0yC6Goo4mLj901fXx6pZzKG5A== X-Google-Smtp-Source: APXvYqxkh5jvsKtB7zLA6qKpix95JeAIwIFrX0WRqlAuCLmFQpKrKljFdeMBb/DMKUIjAIXMzawtlQ== X-Received: by 2002:a63:7c0d:: with SMTP id x13mr70206332pgc.360.1564510594054; Tue, 30 Jul 2019 11:16:34 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id g1sm106744083pgg.27.2019.07.30.11.16.33 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 30 Jul 2019 11:16:33 -0700 (PDT) From: Stephen Boyd To: linux-kernel@vger.kernel.org Cc: Zhang Rui , Eduardo Valentin , Daniel Lezcano , linux-pm@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH v6 43/57] thermal: Remove dev_err() usage after platform_get_irq() Date: Tue, 30 Jul 2019 11:15:43 -0700 Message-Id: <20190730181557.90391-44-swboyd@chromium.org> X-Mailer: git-send-email 2.22.0.709.g102302147b-goog In-Reply-To: <20190730181557.90391-1-swboyd@chromium.org> References: <20190730181557.90391-1-swboyd@chromium.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // While we're here, remove braces on if statements that only have one statement (manually). Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-pm@vger.kernel.org Cc: Greg Kroah-Hartman Signed-off-by: Stephen Boyd --- Please apply directly to subsystem trees drivers/thermal/broadcom/brcmstb_thermal.c | 4 +--- drivers/thermal/da9062-thermal.c | 4 +--- drivers/thermal/db8500_thermal.c | 2 -- drivers/thermal/rockchip_thermal.c | 4 +--- drivers/thermal/st/st_thermal_memmap.c | 4 +--- drivers/thermal/st/stm_thermal.c | 4 +--- drivers/thermal/ti-soc-thermal/ti-bandgap.c | 4 +--- 7 files changed, 6 insertions(+), 20 deletions(-) diff --git a/drivers/thermal/broadcom/brcmstb_thermal.c b/drivers/thermal/broadcom/brcmstb_thermal.c index 5825ac581f56..619ad86dbdbc 100644 --- a/drivers/thermal/broadcom/brcmstb_thermal.c +++ b/drivers/thermal/broadcom/brcmstb_thermal.c @@ -331,10 +331,8 @@ static int brcmstb_thermal_probe(struct platform_device *pdev) priv->thermal = thermal; irq = platform_get_irq(pdev, 0); - if (irq < 0) { - dev_err(&pdev->dev, "could not get IRQ\n"); + if (irq < 0) return irq; - } ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, brcmstb_tmon_irq_thread, IRQF_ONESHOT, DRV_NAME, priv); diff --git a/drivers/thermal/da9062-thermal.c b/drivers/thermal/da9062-thermal.c index c32709badeda..2917b1cee1e9 100644 --- a/drivers/thermal/da9062-thermal.c +++ b/drivers/thermal/da9062-thermal.c @@ -254,10 +254,8 @@ static int da9062_thermal_probe(struct platform_device *pdev) thermal->zone->passive_delay); ret = platform_get_irq_byname(pdev, "THERMAL"); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to get platform IRQ.\n"); + if (ret < 0) goto err_zone; - } thermal->irq = ret; ret = request_threaded_irq(thermal->irq, NULL, diff --git a/drivers/thermal/db8500_thermal.c b/drivers/thermal/db8500_thermal.c index b71a999d17d6..e391b5687147 100644 --- a/drivers/thermal/db8500_thermal.c +++ b/drivers/thermal/db8500_thermal.c @@ -408,7 +408,6 @@ static int db8500_thermal_probe(struct platform_device *pdev) low_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_LOW"); if (low_irq < 0) { - dev_err(&pdev->dev, "Get IRQ_HOTMON_LOW failed.\n"); ret = low_irq; goto out_unlock; } @@ -423,7 +422,6 @@ static int db8500_thermal_probe(struct platform_device *pdev) high_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_HIGH"); if (high_irq < 0) { - dev_err(&pdev->dev, "Get IRQ_HOTMON_HIGH failed.\n"); ret = high_irq; goto out_unlock; } diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c index 343c2f5c5a25..00169e5a719a 100644 --- a/drivers/thermal/rockchip_thermal.c +++ b/drivers/thermal/rockchip_thermal.c @@ -1229,10 +1229,8 @@ static int rockchip_thermal_probe(struct platform_device *pdev) return -ENXIO; irq = platform_get_irq(pdev, 0); - if (irq < 0) { - dev_err(&pdev->dev, "no irq resource?\n"); + if (irq < 0) return -EINVAL; - } thermal = devm_kzalloc(&pdev->dev, sizeof(struct rockchip_thermal_data), GFP_KERNEL); diff --git a/drivers/thermal/st/st_thermal_memmap.c b/drivers/thermal/st/st_thermal_memmap.c index a824b78dabf8..a0114452d11f 100644 --- a/drivers/thermal/st/st_thermal_memmap.c +++ b/drivers/thermal/st/st_thermal_memmap.c @@ -94,10 +94,8 @@ static int st_mmap_register_enable_irq(struct st_thermal_sensor *sensor) int ret; sensor->irq = platform_get_irq(pdev, 0); - if (sensor->irq < 0) { - dev_err(dev, "failed to register IRQ\n"); + if (sensor->irq < 0) return sensor->irq; - } ret = devm_request_threaded_irq(dev, sensor->irq, NULL, st_mmap_thermal_trip_handler, diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c index cf9ddc52f30e..4697849de1ca 100644 --- a/drivers/thermal/st/stm_thermal.c +++ b/drivers/thermal/st/stm_thermal.c @@ -487,10 +487,8 @@ static int stm_register_irq(struct stm_thermal_sensor *sensor) int ret; sensor->irq = platform_get_irq(pdev, 0); - if (sensor->irq < 0) { - dev_err(dev, "%s: Unable to find IRQ\n", __func__); + if (sensor->irq < 0) return sensor->irq; - } ret = devm_request_threaded_irq(dev, sensor->irq, stm_thermal_alarm_irq, diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c index 2fa78f738568..1747dcaba365 100644 --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c @@ -787,10 +787,8 @@ static int ti_bandgap_talert_init(struct ti_bandgap *bgp, int ret; bgp->irq = platform_get_irq(pdev, 0); - if (bgp->irq < 0) { - dev_err(&pdev->dev, "get_irq failed\n"); + if (bgp->irq < 0) return bgp->irq; - } ret = request_threaded_irq(bgp->irq, NULL, ti_bandgap_talert_irq_handler, IRQF_TRIGGER_HIGH | IRQF_ONESHOT,