Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161068AbbBCTin (ORCPT ); Tue, 3 Feb 2015 14:38:43 -0500 Received: from mail-ig0-f181.google.com ([209.85.213.181]:44949 "EHLO mail-ig0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966481AbbBCTik (ORCPT ); Tue, 3 Feb 2015 14:38:40 -0500 Date: Tue, 3 Feb 2015 11:38:35 -0800 From: Dmitry Torokhov To: Roman Volkov Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Grant Likely , Hans de Goede , Jiri Kosina , Wolfram Sang , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Roman Volkov , Tony Prisk Subject: Re: [PATCH 4/5] i8042: Prepare i8042 driver for DT support Message-ID: <20150203193835.GC20256@dtor-ws> References: <1422913730-12663-1-git-send-email-v1ron@v1ros.org> <1422913730-12663-4-git-send-email-v1ron@v1ros.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1422913730-12663-4-git-send-email-v1ron@v1ros.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1408 Lines: 33 On Tue, Feb 03, 2015 at 12:48:49AM +0300, Roman Volkov wrote: > Use platform_device_probe() instead of platform_create_bundle() when > compiled with DT support, since the latter function is not suitable for > handling the OF device tree. > > The order of initialization is changed, since i8042_platform_init() for DT > requires initialized platform_device structure. To avoid searching of the > compatible node twice, the platform_device structure pointer must be passed > to the i8042_platform_init() function right after initialization by > platform_device_probe(). > > Signed-off-by: Tony Prisk > Signed-off-by: Roman Volkov > --- > > Yes, many of these ifdefs look ugly. Suggestions on how to avoid this are > welcome (except using of_find_compatible_node() for searching the node twice > before calling the probe function). I guess we need to split the dirver into part that create platform device and the standard driver part. Then your OF code can supply most of the needed data via resources/platform data. Yes, it is a larger change, but the current splat of ifdefs makes my eyes water. Thanks. -- Dmitry -- 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/