From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Daney Subject: Re: [PATCH] acpi, property: Export acpi_dev_prop_read_single call. Date: Wed, 5 Aug 2015 16:17:21 -0700 Message-ID: <55C29981.8060308@caviumnetworks.com> References: <1438729319-9146-1-git-send-email-ddaney.cavm@gmail.com> <55C24737.8000309@caviumnetworks.com> <55C26EB9.7010504@gmail.com> <1501387.bDOHyjjWvt@vostro.rjw.lan> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mail-bl2on0081.outbound.protection.outlook.com ([65.55.169.81]:46576 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753204AbbHEXRd (ORCPT ); Wed, 5 Aug 2015 19:17:33 -0400 In-Reply-To: <1501387.bDOHyjjWvt@vostro.rjw.lan> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: "Rafael J. Wysocki" Cc: David Daney , Tomasz Nowicki , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Len Brown , Robert Richter , David Daney On 08/05/2015 04:23 PM, Rafael J. Wysocki wrote: > On Wednesday, August 05, 2015 01:14:49 PM David Daney wrote: >> On 08/05/2015 10:26 AM, David Daney wrote: >>> On 08/05/2015 06:43 AM, Tomasz Nowicki wrote: >>>> On 05.08.2015 15:48, Rafael J. Wysocki wrote: >>>>> On Tuesday, August 04, 2015 04:01:59 PM David Daney wrote: >>>>>> From: Tomasz Nowicki >>>>>> >>>>>> Fixes the following build error when building drivers as modules: >>>>>> >>>>>> ERROR: "acpi_dev_prop_read_single" [drivers/net/phy/mdio-octeon.ko] >>>>>> undefined! >>>>>> ERROR: "acpi_dev_prop_read_single" >>>>>> [drivers/net/ethernet/cavium/thunder/thunder_bgx.ko] undefined! >>>>> >>>>> Can you please tell me why the drivers in question use that function >>>>> directly, although they aren't supposed to? >>>>> >>>>> Clearly, their authors had not tried to build them as modules or they >>>>> would have noticed the problem at the development stage already. >>>>> >>>>> What would be wrong with using the generic device properties API >>>>> instead? >>>>> >>>> Yes, you are right. We should use: >>>> int device_property_read_u64_array(struct device *dev, const char >>>> *propname, u64 *val, size_t nval); >>>> >>> >>> Thanks all, for the review and suggestions. We we try the suggested >>> approach and see how it goes... >>> >> >> Actually I don't think device_property_read_u64_array() will work. >> >> We are traversing a reference to a different acpi_device via >> acpi_dev_get_property_reference(), > > Why? Network device has a "phy-handle" (traversed with acpi_dev_get_property_reference()), and we want to get some properties of that phy. I could turn the question around to you: Why export acpi_dev_get_property_reference()? If there is a reason to export that, then you should let people use the result. > >> so there is no struct device * >> available for a call to device_property_read_u64_array(). This looks >> like a deficiency in the device_property_* framework, so for the time >> being I guess we will call acpi_dev_get_property(), which is exported, >> and decode the thing in the driver. > > Please don't. > > I'd like to understand what's missing. > > Thanks, > Rafael >