From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755420AbbCELyw (ORCPT ); Thu, 5 Mar 2015 06:54:52 -0500 Received: from mail-wg0-f48.google.com ([74.125.82.48]:38408 "EHLO mail-wg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752379AbbCELyv (ORCPT ); Thu, 5 Mar 2015 06:54:51 -0500 Message-ID: <54F8445B.10805@gmail.com> Date: Thu, 05 Mar 2015 12:56:11 +0100 From: Ingo Flaschberger User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Markus Pargmann CC: linux-kernel@vger.kernel.org Subject: Re: Fwd: Re: unbind/bind w1-gpio with device tree produce a crash References: <54F73518.3000304@gmail.com> <54F7C5D4.3000604@gmail.com> <20150305073524.GC8062@pengutronix.de> In-Reply-To: <20150305073524.GC8062@pengutronix.de> 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 Dear Markus, Am 05.03.2015 um 08:35 schrieb Markus Pargmann: > Good point. The easy way to solve this may be to check in the remove > function if the devicetree node for this device is available. If it is, > we know that platform_data was allocated with devm_* and we can set > platform_data to NULL. > > I think the better solution would be to create a private structure with > the same data as w1_gpio_platform_data. It may even use the same struct. > But it should not be stored in platform_data. Instead it should be > handled seperately. For DT we can allocate it using devm_kzalloc(). And > for probing with pdata, this could just be the pointer to the pdata > within the device struct. > > Could you give me more details about the "private structure" idea, perhaps off-list? The backup method via w1_gpio_*_orig collides when more than 1 bus is used, this data could be stored in the private structure too. Kind regards, Ingo Flaschberger