From patchwork Fri Jun 14 15:35:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Schneider X-Patchwork-Id: 10995853 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 6773914BB for ; Fri, 14 Jun 2019 15:35:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5602B286DF for ; Fri, 14 Jun 2019 15:35:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48D42286E6; Fri, 14 Jun 2019 15:35:56 +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=-7.9 required=2.0 tests=BAYES_00,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 7F8B6286DF for ; Fri, 14 Jun 2019 15:35:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726455AbfFNPfz (ORCPT ); Fri, 14 Jun 2019 11:35:55 -0400 Received: from smtp.radiodata.biz ([116.203.112.52]:39271 "EHLO smtp.radiodata.biz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbfFNPfy (ORCPT ); Fri, 14 Jun 2019 11:35:54 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp.radiodata.biz (Postfix) with ESMTP id 4B4363E8E7; Fri, 14 Jun 2019 17:35:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at smtp.radiodata.biz Received: from smtp.radiodata.biz ([116.203.112.52]) by localhost (smtp.radiodata.biz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m8kZQTfT285D; Fri, 14 Jun 2019 17:35:44 +0200 (CEST) Received: from mail.radiodata.biz (p578044f8.dip0.t-ipconnect.de [87.128.68.248]) by smtp.radiodata.biz (Postfix) with ESMTPSA id D767E3E8E6; Fri, 14 Jun 2019 17:35:44 +0200 (CEST) Received: from [192.168.2.213] (raphael-WINPC.radiodata.xx [192.168.2.213]) by mail.radiodata.biz (Postfix) with ESMTPSA id 6D3E820264; Fri, 14 Jun 2019 17:35:44 +0200 (CEST) Subject: [PATCHv2] hwmon, gpio-fan: fix that sysfs_notify in void fan_alarm_notify is not received in userspace To: Guenter Roeck Cc: linux-hwmon@vger.kernel.org References: <2680453b-9631-3cb9-06c4-326d63e93988@roeck-us.net> <178c4302-3333-b60f-afbd-ff73fbe943ca@radiodata.biz> <20190614145256.GA464@roeck-us.net> From: Christian Schneider Message-ID: Date: Fri, 14 Jun 2019 17:35:43 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190614145256.GA464@roeck-us.net> Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Alarms on gpio-fan can't be received from sysfs_notify, because the wrong kobject is passed. This patch fixes this. Signed-off-by: Christian Schneider diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c index 84753680a4e8..76377791ff0e 100644 --- a/drivers/hwmon/gpio-fan.c +++ b/drivers/hwmon/gpio-fan.c @@ -54,8 +54,8 @@ static void fan_alarm_notify(struct work_struct *ws) struct gpio_fan_data *fan_data = container_of(ws, struct gpio_fan_data, alarm_work); - sysfs_notify(&fan_data->dev->kobj, NULL, "fan1_alarm"); - kobject_uevent(&fan_data->dev->kobj, KOBJ_CHANGE); + sysfs_notify(&fan_data->hwmon_dev->kobj, NULL, "fan1_alarm"); + kobject_uevent(&fan_data->hwmon_dev->kobj, KOBJ_CHANGE); } static irqreturn_t fan_alarm_irq_handler(int irq, void *dev_id)