From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752249AbdHNSEv (ORCPT ); Mon, 14 Aug 2017 14:04:51 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:36294 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751098AbdHNSEt (ORCPT ); Mon, 14 Aug 2017 14:04:49 -0400 Date: Mon, 14 Aug 2017 11:04:47 -0700 From: Guenter Roeck To: Sudeep Holla Cc: ALKML , LKML , DTML , Roy Franz , Harb Abdulhamid , Nishanth Menon , Arnd Bergmann , Loc Ho , Alexey Klimov , Ryan Harkin , Jassi Brar , linux-hwmon@vger.kernel.org Subject: Re: [PATCH v2 16/18] hwmon: add support for sensors exported via ARM SCMI Message-ID: <20170814180447.GA9577@roeck-us.net> References: <1501857104-11279-1-git-send-email-sudeep.holla@arm.com> <1501857104-11279-17-git-send-email-sudeep.holla@arm.com> <20170804193231.GA18153@roeck-us.net> <20e0a388-79a1-a7f1-57b4-fa5993eed9bf@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 14, 2017 at 04:09:18PM +0100, Sudeep Holla wrote: > Hi Guenter, > > On 07/08/17 13:25, Sudeep Holla wrote: > > > > > > On 04/08/17 20:32, Guenter Roeck wrote: > >> On Fri, Aug 04, 2017 at 03:31:42PM +0100, Sudeep Holla wrote: > > > > [...] > > > >>> + platform_set_drvdata(pdev, scmi_sensors); > >>> + > >>> + hwdev = devm_hwmon_device_register_with_groups(dev, "scmi_sensors", > >>> + scmi_sensors, > >>> + scmi_sensors->groups); > >> > >> Can you rework this to use devm_hwmon_device_register_with_info(), > >> and if possible let it handle the thermal registration ? > >> > > > > Thanks for the pointers. I will check on the possibility and use it if > > possible. > > > > I had a look at devm_hwmon_device_register_with_info. It mostly deals > with constant structures where all the attributes are known at the boot > time. In case of SCMI, the firmware presents all the sensors and all the > information(type, scale, name/label, ...etc). Unless I create those > structures dynamically and typecast as const during probe, I can't get > it working. Are you OK with that ? If so, I can try making those changes. > Yes, please. What operations exactly fail, though ? The idea was that the structures are not modified by the infrastructure code, not that they must be constant in the driver. Maybe some of the structure definitions are simply wrong. Thanks, Guenter