Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754655AbbIABYL (ORCPT ); Mon, 31 Aug 2015 21:24:11 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:53496 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754088AbbIABYK (ORCPT ); Mon, 31 Aug 2015 21:24:10 -0400 Subject: Re: [RFC 0/4] of: introduce of_dev_get_platdata() To: Rob Herring References: <1440753128-3288-1-git-send-email-milo.kim@ti.com> CC: Grant Likely , "devicetree@vger.kernel.org" , Dmitry Torokhov , Felipe Balbi , Greg Kroah-Hartman , Lee Jones , Rob Herring , Samuel Ortiz , Tony Lindgren , "linux-kernel@vger.kernel.org" From: "Kim, Milo" Message-ID: <55E4FE2C.4040409@ti.com> Date: Tue, 1 Sep 2015 10:23:56 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1780 Lines: 41 Hi Rob, On 8/28/2015 9:59 PM, Rob Herring wrote: > On Fri, Aug 28, 2015 at 4:12 AM, Milo Kim wrote: >> >New function, 'of_dev_get_platdata()' >> > - provides unified handling of getting device platform data >> > - supports DT and non-DT(legacy) cases >> > - removes duplicated code from each driver >> > - keeps driver specific code simple in each driver > This works in cases where DT data and platform_data are aligned. In > many cases they are not. A common binding problem is people blindly > copying platform_data fields to DT properties for things that are not > h/w properties. I worry that this would encourage this behavior. OK, got your point. Thanks. > > We already have a generalized method for retrieving properties > independent of DT or ACPI. There's no reason this couldn't be extended > to retrieve properties out of platform_data using the same interface. > > Also, perhaps in some drivers we can remove platform_data now if all > users are converted to DT. This work requires two steps. 1) remove platform data configuration from board-*.c 2) if all host/platform support only the DT, then move device platform data structure in a header to each driver space. However, I'm concerning about some use case. After this cleanup, drivers may not work properly in some platforms which do not support the DT. There is no way to configure HW properties. Drivers should run on any kind of hosts(processors) so I'm thinking about the compatibility/dependency issue. Am I missing something? Milo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/