Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1030037iob; Fri, 13 May 2022 20:16:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/4ygk8FD9g1iLthqIC45ttyem4iZTqZtDV9Q9bc/vrKCLih5hDL6al5StCJTt2eaarIlm X-Received: by 2002:a5d:5707:0:b0:20a:c768:bc8 with SMTP id a7-20020a5d5707000000b0020ac7680bc8mr6249003wrv.565.1652498208577; Fri, 13 May 2022 20:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652498208; cv=none; d=google.com; s=arc-20160816; b=PHH6JC8k6abUXJTEBtONyD7ykJFq3sTIeHvN1Xb3EFdTJq6eQ2JomwNOaZEk65aLkS NrCvOqdOUJoztqjki3i0zWONKrmVlAUFdGWJ1nfTTrU8zvCfTnhIVwP8V8W90xyJcIQ2 b0EJ262zhRT5H0ag8B+9chCY21Ac3GKrWsivLCaF79kFjRm3VE9N8X1gZabysEG5Jyj+ +XWDhn/7UyFho/Im3QwjLYwlcMwxSG1oZgjTgk3/rajc23MXM6uKi996RQifIKWRTk4d y95yue9t5Jl5ufx5Zwzezn8JHmjZyPrxxCluVaVtVrUOsPQkqVzsweBEuLFBAV1fbpV1 DNHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OXgBzGZGEU7zxP/doiWF3UTQSdG2zI3MrmBCu1stYVY=; b=Qv2yax+dIic+JHdVnwYh7PVJEgAvM7Vvp+4Us+pk9/gvfQz4Vg5kiPICNQZLqdanut 2zPETXgSxR+5H0yaY/wLKG2C/Wa5Z+A8dMF+VkeDjvm3pK12NrimyVRnmaaynZJRbhW0 XnuVhzQ3uRYxFpphgqglnIe2hgEJC6BYOK0CAmgsEDdJJul/KLgjodtPRG6cmMSJEHVh euZuobEPh0Gk8VyqsrCSsl9xnL5azMOkt6++tUbfZ2qYvyNzmIMtHKJ2sEsoT4vcORWB xGxzbZbtrF6goo5lLg8PsrXzgT87rYl0AT2eCeIpOiwrJ0jdX/WFV5sdioaHz87ygvpm 0uNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=QbdeR4HZ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i4-20020a1c3b04000000b0039443835d66si6568655wma.104.2022.05.13.20.16.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 20:16:48 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=QbdeR4HZ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 296623E3072; Fri, 13 May 2022 16:55:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377996AbiEMICb (ORCPT + 99 others); Fri, 13 May 2022 04:02:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239375AbiEMICW (ORCPT ); Fri, 13 May 2022 04:02:22 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C112E3DA6B for ; Fri, 13 May 2022 01:02:20 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id bd25-20020a05600c1f1900b0039485220e16so5090384wmb.0 for ; Fri, 13 May 2022 01:02:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=OXgBzGZGEU7zxP/doiWF3UTQSdG2zI3MrmBCu1stYVY=; b=QbdeR4HZ3E9008FT1y7yNIW+xDhJpNx1BUEBRMxckW2cHxFJMiGqMabDWXxOSmPco2 WgMLwixB0mWf4mfHTlMkLHfejLDiUsutaNcyqZyUiAIrnU1XipA1dSYW9VTlDUBoPGGu 4rZ68ON1okF8uAY1YxGi/dPqwN1eJzwoq7D0PGSXhv+HNI9bB5K6vVAedUcC+JrceBbp xltN53IuAkpVXXAYhUoN9MtAjO/jDEC1L6BxjCRr8DAr7sdpvOuh6P1NnzJ8U12wB/H9 aVwa4yd/jMvQrGszv569DrYm63CnUZPkAo5RN0H2+Sp8xjnHCNNGiM5tIrq1ClcrRt9s YnYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=OXgBzGZGEU7zxP/doiWF3UTQSdG2zI3MrmBCu1stYVY=; b=sNhlGVBC7QfdnN6DgKrhr2WR8gJc7EgS19IaAC6uovDSgBScz419kJDG/e65LDy8+E +OBnRTYKjIcGEcoWK3lyLkR1xdyJezhJjlWo0FSWbsZu69Hf7jfavUC072eUzFotw3aR qvk/NWoJxuRaEr+PWS67MVlgVfxXA00VcDiN3B6YWAyX+RjAbou1FTMrqkEhYKiexvSk ROoReek6zEkyqCeMA+iJrtU8NvIYPZj5X7N0DQxhtEz16OK6auIeR7z59nVkf6TX8xHh D9GdUz6cYqicWXkwipbZcaqWGREGbZx0nKbedFpHXHEbiF2Cr4iNoChI5MiOJB/ZYPts 5ukQ== X-Gm-Message-State: AOAM531utfeIdBE33epXFGnn2XOln7Bjz60eik/nuSxFuCgSXu4qV5zR luwiPLAOy6JpLIfH37N37HFkTQ== X-Received: by 2002:a05:600c:4ba1:b0:394:9ae3:ee98 with SMTP id e33-20020a05600c4ba100b003949ae3ee98mr13735148wmp.160.1652428939076; Fri, 13 May 2022 01:02:19 -0700 (PDT) Received: from Red ([2a01:cb1d:3d5:a100:264b:feff:fe03:2806]) by smtp.googlemail.com with ESMTPSA id m32-20020a05600c3b2000b003942a244ed2sm2283993wms.23.2022.05.13.01.02.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 01:02:18 -0700 (PDT) Date: Fri, 13 May 2022 10:02:14 +0200 From: LABBE Corentin To: Guenter Roeck Cc: jdelvare@suse.com, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Zhang Rui Subject: Re: [PATCH v3 2/2] hwmon: acpi_power_meter: convert to hwmon_device_register_with_info Message-ID: References: <20220509063010.3878134-1-clabbe@baylibre.com> <20220509063010.3878134-3-clabbe@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le Wed, May 11, 2022 at 07:10:29PM -0700, Guenter Roeck a ?crit : > Corentin, > > On 5/8/22 23:30, Corentin Labbe wrote: > > Booting lead to a hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info(). > > So let's convert the driver to use hwmon_device_register_with_info(). > > > > Signed-off-by: Corentin Labbe > > --- > [ ... ] > > > @@ -836,20 +740,20 @@ static void acpi_power_meter_notify(struct acpi_device *device, u32 event) > > if (res) > > break; > > > > - remove_attrs(resource); > > + remove_domain_devices(resource); > > setup_attrs(resource); > > Zhang Rui found an interesting problem with this code: > It needs a call to sysfs_update_groups(hwmon_dev->groups) > to update sysfs attribute visibility, probably between > remove_domain_devices() and setup_attrs(). > > > break; > > case METER_NOTIFY_TRIP: > > - sysfs_notify(&device->dev.kobj, NULL, POWER_AVERAGE_NAME); > > + hwmon_notify_event(&device->dev, hwmon_power, hwmon_power_average, 0); > > ... which makes realize: The notification device should be the hwmon device. > That would be resource->hwmon_dev, not the acpi device. > Hello I will fix this, but do you have an example how to test thoses code path easily ? Thanks