Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp123829yba; Wed, 3 Apr 2019 05:50:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxoz5GkpqqV1r3NpjPBA1kzRhPRZPI0j7uFUnCAabtzqeeGW2JWVJiWmIiodzmfTFWiiP2G X-Received: by 2002:a63:e70c:: with SMTP id b12mr72851821pgi.399.1554295847162; Wed, 03 Apr 2019 05:50:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554295847; cv=none; d=google.com; s=arc-20160816; b=EzHu8OF79ZGE22MUlZzKH1F2IEEo4I64DxngGA9EkZXiN1s1Ic9DfiY3BjK7Kw0DWY Uf6MCxOPJcibe7dL7GkiiuSd58ML3GEgkfw4C2RW5S/pL4SOuxr/YP09k/LZDUXlnBLR wVgZP0CMFsOwBr68bLQsh4RllNA88uE3suSJbyTdI6oSsQo71p0yjTj/ZNP55bbj6hUL sNlTSRs3Og5KmMqbP92d29zyWy/SRNRZI3BaOv0GCf2IlVGHBUVMvje/x2QEKUkYy6a4 DFloV5KjKNbCPyz76elruKGozDZ71aFB7qJIe2SMDU9e0BxY7HvY+z7xlfQ49MBxVzNr IqVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=kgfHHigtu1SfIRuX0VZrl+HeggEgdbEddLyDDWS+eTQ=; b=khe1aYQA1I+WLR5PvE4zIT3LzNqzG87ua+btWt9+LdF+Zmw5feF+j7gaLqzTky4dLI mXRBhm51fjH4sjC9WWiItLdeRjNpDg/NfvsLYsaLlNpOSQ6joar3RnsGCeFDuex6BxrM hp5KkSHxSNGVSETmF5ctgHHyu9wISS1V/LjocGPMDUn47YGW1Wfe8W1E58BYeAkN+vb1 0d+ZlOpkfykUL7fNBxFwj9UMh+mARtb8VRewfdOfqamTTswXKHWZ+kc8szr3AQdWRbQs Pwk3ycIHjyKRX5XZtpi1GaEDcFmCsQF02x4HNhz/tg1dfJw4LOh7Zb40m19+rT0hpJqb X+jw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n7si13640763pff.190.2019.04.03.05.50.31; Wed, 03 Apr 2019 05:50:47 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726511AbfDCMtt (ORCPT + 99 others); Wed, 3 Apr 2019 08:49:49 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:60871 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbfDCMts (ORCPT ); Wed, 3 Apr 2019 08:49:48 -0400 Received: from stefan-Vostro-260.fritz.box ([109.104.37.190]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M7auL-1hHS4v2zDJ-0085fP; Wed, 03 Apr 2019 14:48:52 +0200 From: Stefan Wahren To: Kamil Debski , Bartlomiej Zolnierkiewicz , Jean Delvare , Guenter Roeck , Rob Herring , Mark Rutland , Robin Murphy Cc: Lukasz Majewski , linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Wahren , "# 4 . 14" Subject: [PATCH] hwmon: pwm-fan: Disable PWM if fetching cooling data fails Date: Wed, 3 Apr 2019 14:48:33 +0200 Message-Id: <1554295713-18656-1-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 X-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k3GGhfM= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case pwm_fan_of_get_cooling_data() fails we should disable the PWM just like in the other error cases. Reported-by: Guenter Rock Signed-off-by: Stefan Wahren Fixes: 2e5219c77183 ("hwmon: (pwm-fan) Read PWM FAN configuration from device tree") Cc: # 4.14 --- drivers/hwmon/pwm-fan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c index 167221c..e4c5197 100644 --- a/drivers/hwmon/pwm-fan.c +++ b/drivers/hwmon/pwm-fan.c @@ -271,7 +271,7 @@ static int pwm_fan_probe(struct platform_device *pdev) ret = pwm_fan_of_get_cooling_data(&pdev->dev, ctx); if (ret) - return ret; + goto err_pwm_disable; ctx->pwm_fan_state = ctx->pwm_fan_max_state; if (IS_ENABLED(CONFIG_THERMAL)) { -- 2.7.4