Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2920769imu; Sun, 11 Nov 2018 04:02:54 -0800 (PST) X-Google-Smtp-Source: AJdET5fhAWXFAVsSJ3o248vFbOJbO2/i1ugoxwplGRzYQIeg6hO7M02CwlSnqVSnYtcJo/5rNv8g X-Received: by 2002:a62:5fc5:: with SMTP id t188-v6mr16193448pfb.84.1541937774334; Sun, 11 Nov 2018 04:02:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541937774; cv=none; d=google.com; s=arc-20160816; b=o/W38ckTLPx3PXdhoquvolFd8wuzEoYDBKBZXalJ3DqAyazfdxEElubHo7rQnhfBa/ cSx6cdZhvh9mvNAY+iXHWaqbWha9fmWxnkKNqtr3EwrsZwhSMMdJaeLLNzTJ8bE8wsjF /BrxNhPUK9FIcnNIZXjdBjrK8sEIN2eNwqUPh65eWFfNyyNYyZxfgm2155uZdG/GuR/o LyXaX7e2Kn/oF0lOG6F6LimFDfRFqDnpaZx4NycZuEE7iTxrpwmCiVFqkDnhqgRFrCb/ N4KHzihVBOUcbWtvtSNEKEf5UXrcfVtcLlgkBc52fpDAgEEK7/F6DSp84a1BoAhLW0hZ T95w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=oMYP9LkeqaPgk3V9wMtdXtJG5kuTkABFMFspZJnhPkQ=; b=BU4mTGq1kShSoMyv22xxFRectnPDUNCIRMh+YYuy2mbA7bQyyxDoKhxJjR28nqPlUK JGwAqKrmk2W8Am2gsoCIzsALOdUlbOwZ3gYRZpiN3HgrCcGACqWjPjCnXOLYHwYEgY+z 7NZMDxSvprf2bsghIkFgNwxG7I5iREHT0lsrsaDQ2WtSe7RsETKJp7nwepn+ExK5iOW7 yMNdzKCymIzhb2ssdTRjIE3pTbRx1zwAiG6ICgccBTKwcwVr/Auko30VrjBAwaxF6czU rcLv1y4jWSWlTJyvHyNjKv0TrNvy1a02nk/1jbwJwH7MnhVL3728CejMdnhG6A0PPZh4 tIpQ== 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 h190-v6si15200048pfb.206.2018.11.11.04.02.38; Sun, 11 Nov 2018 04:02:54 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727727AbeKKVum (ORCPT + 99 others); Sun, 11 Nov 2018 16:50:42 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:56911 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727492AbeKKVum (ORCPT ); Sun, 11 Nov 2018 16:50:42 -0500 Received: from localhost.localdomain ([37.4.249.153]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N5W0q-1fPBCS2EFm-016xot; Sun, 11 Nov 2018 13:01:38 +0100 From: Stefan Wahren To: Eric Anholt , Florian Fainelli , Jean Delvare , Guenter Roeck , Greg Kroah-Hartman Cc: linux-rpi-kernel@lists.infradead.org, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Wahren Subject: [PATCH] hwmon: rpi: Fix initial notify Date: Sun, 11 Nov 2018 13:01:11 +0100 Message-Id: <1541937671-26385-1-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:HEVIdEl0kizgBdNf0M5wstvyz7s6HdToU1mddQPsbGgHjkiBWSZ SKazwNvgO6cbViYoUW17vGwM+wtH3UvfMleX6l3XXOJUwGoJIZP7C9iMFyqzOhl1AlaWRQ+ nGjpMnsO6ZoiSjYhxMPB911ALciozsvmmLqnauqOofp2A/Y1/Tcfzfrv2IhQJICMhDSNaco akAN1etmFdi29Cdupykhw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V01:K0:tzezqudV+18=:I+avf+CPQCA+RPEHvwv55R iJN07WrrHGCkxDyTa1k+J8anYCg6oDlByPsB4O51GNXOi1XH2wPejZd6QJflDwV0IjWsd1mfU xmQwbUh5YsPt6czgCadtNhv89tCiiHGxGyLiNjZpXICCRYxcY9szc+T27wAi6tAeQsahSk7Zc P7+RqK/K3qtckuZiInGDWLzDvbMkItVWmxB/86m6NH4QbXCqJo/m0F6yZWCq1t/ocW/NmK9nH 3sFSBLGNA+DGHqRLq1Tp+a+Xf1XuQlWwVYusgY3z9tNBdbTG9fQhBwac+oBJ+ZnF8S5WtdcSk T31iv44dd2DkPTXqRuzSBWKnMQIZbabtWOYI9paJgywle7kdbJJlWx/kHONkEeKdjM7+MCUVn 9iAWGJiu9tZ+i+FxYqUlLGOlZZW/sJiXzizD+WQYXdDiNh9lU2926j9Ydc+vF5fF1DzwaLsTf 7cvqwTu8gBFVOffZhsHT5+loV6D5WvJjY3JUPmhraz4ioeagBG6+s34gN3LtPYnUYNJO/Cd3Z CLnkDRAoKUNCeqhqsifSzcy49XV5h8YPrkSBWWBek7gAzU/DVI1mXLgcESMoe77NdlLeCqLUm 0W+phul1X1/9/WPqPkr6j9E7MjgIbo7XcPtmy+treFmpnZWz5766NVHRJ+RPCN9RVFocCcILy +n2ryGG9Llo5cGCbUU+eSWsigfVGTGmQzvatSRpt262UKg3EyZrqtedY+GLnKMMvAqra/GKvs 0SObqg+2lnFLxgOSq/dM7hz7QuKk2JFmfuuXu0T+aMTpc9ZZx90sE6kMjBz8cF+hBFutqehUk 10cHzngQFaS21pN/PQ2gpU1ZlGFfqQ3gEjQz8zF7KGhTS5FiYY= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case an under-voltage happens before probing the driver wont write the critical warning into the kernel log. So don't init of last_throttled during probe and fix this issue. Fixes: 74d1e007915f ("hwmon: Add support for RPi voltage sensor") Reported-by: "Noralf Trønnes" Signed-off-by: Stefan Wahren --- drivers/hwmon/raspberrypi-hwmon.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/hwmon/raspberrypi-hwmon.c b/drivers/hwmon/raspberrypi-hwmon.c index be5ba46..0d04572 100644 --- a/drivers/hwmon/raspberrypi-hwmon.c +++ b/drivers/hwmon/raspberrypi-hwmon.c @@ -115,7 +115,6 @@ static int rpi_hwmon_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct rpi_hwmon_data *data; - int ret; data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); if (!data) @@ -124,11 +123,6 @@ static int rpi_hwmon_probe(struct platform_device *pdev) /* Parent driver assure that firmware is correct */ data->fw = dev_get_drvdata(dev->parent); - /* Init throttled */ - ret = rpi_firmware_property(data->fw, RPI_FIRMWARE_GET_THROTTLED, - &data->last_throttled, - sizeof(data->last_throttled)); - data->hwmon_dev = devm_hwmon_device_register_with_info(dev, "rpi_volt", data, &rpi_chip_info, -- 2.7.4