Received: by 10.223.185.116 with SMTP id b49csp3753019wrg; Mon, 19 Feb 2018 05:31:06 -0800 (PST) X-Google-Smtp-Source: AH8x225y8nfh1zCv8nnexUb3YhU7ySFT7SCOdeFRKrHs7PT7+etkl0ZBteaotJI1GAAauPYkVlXB X-Received: by 10.101.85.204 with SMTP id k12mr12681403pgs.40.1519047066265; Mon, 19 Feb 2018 05:31:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519047066; cv=none; d=google.com; s=arc-20160816; b=ydasxucq/tIq1csJcHgRaEHorOliPK7bxVBqbqJoSGW5R/20oXiZunsHMAi76yg1aQ dtgn6QE686IMEHMBsnT9Br6uZrBWQs4Y5LMlA0ZkAIx1VGcjB+5hCovbbgZJ23jGysBx d66dGHlNjbIM5vacpswijtQRyzYpXgmr1vMQdqoG69xTvcm5K1KU+OkISXCgkZlrGjEP Zh11VzcQaez01dQV4RjKm1jTijD6d60G5CaiyWe3fTO0APP67vp7HwZHl0HKR23V4oeG XZwejxo3fIkgF/3U6nC6n33sPghXYPnCk84YsmQv1E9yeD3VhSwYGQUN3yM/Ud+pYP2U VkWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=KV6hLsib19Al85kfoIKhCiAbJtC7O08ifcpJdiMePec=; b=Swf7/SG/CMP3jxu6pXZ7KvXiWhMguKiDni6xrDZwgfvSa6Twgb2WSewtlLgS3Sfh88 bad4Sdxghdcf0rEzvfko7+O20ZkbatzsovmAfJT73i+ZBjMs87B6/+cl+IBr8edyi/OT oxWA2rpLFXYFXCl1v7PX9+OCyGsjP3qYhTTvZnMFJEHlg56QHKbbqPnfse6xuDYkZS1D jpV6ad4EMMoViVZcZalHQF/Bsgr6qfTNke5My/GOneSNk8cghRCtEUpC5b39gmwjmp+j rRTPMC/Jb6RCvVtMHKH3v8QTgs2JjJb5/vLqGhs63L/tP32NmBk6qLuHpKmOLfxvq49C d0lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=miF8qKjZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si4119373pfk.67.2018.02.19.05.30.50; Mon, 19 Feb 2018 05:31:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=miF8qKjZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752811AbeBSNaD (ORCPT + 99 others); Mon, 19 Feb 2018 08:30:03 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:48220 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752666AbeBSNaB (ORCPT ); Mon, 19 Feb 2018 08:30:01 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w1JDTrqp001267; Mon, 19 Feb 2018 07:29:53 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1519046993; bh=H19H40YIx4zN+YLX33Ef/BHTUeI8XLfBZxdUorIim1I=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=miF8qKjZgAGnjTbgLC7WiA/X3FQzHmUjcmyD1RUUD8QZCHAR2dmetqvF8eF+JakyV 8MDIr/QTKXYq7kMXSIK8g+74soq3WVbgNxHUzEkLpu9crAw5oW9dFlcA+EVOwlofSG NqeO+gPTjzpOnFLt3ddNsiA1+SWZnUwq2IKQBr1g= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1JDTrij006163; Mon, 19 Feb 2018 07:29:53 -0600 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Mon, 19 Feb 2018 07:29:53 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Mon, 19 Feb 2018 07:29:53 -0600 Received: from [128.247.59.77] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1JDTrJ7012122; Mon, 19 Feb 2018 07:29:53 -0600 Subject: Re: [PATCH] w1: gpio: fix problem with platfom data in w1-gpio To: Pawel Dembicki CC: , Evgeniy Polyakov , Sebastian Reichel , Greg Kroah-Hartman , References: <20180218170629.6045-1-paweldembicki@gmail.com> <20180218171927.6414-1-paweldembicki@gmail.com> From: "Andrew F. Davis" Message-ID: <4e34938c-7dc7-07bc-9074-a726bd06d744@ti.com> Date: Mon, 19 Feb 2018 07:29:53 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180218171927.6414-1-paweldembicki@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/18/2018 11:19 AM, Pawel Dembicki wrote: > In devices, where fdt is used, is impossible to apply platform data > without proper fdt node. > > This patch allow to use platform data in devices with fdt. > > Signed-off-by: Pawel Dembicki > --- Good catch, Acked-by: Andrew F. Davis > drivers/w1/masters/w1-gpio.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c > index a90728ceec5a..7b80762941af 100644 > --- a/drivers/w1/masters/w1-gpio.c > +++ b/drivers/w1/masters/w1-gpio.c > @@ -112,17 +112,16 @@ static int w1_gpio_probe_dt(struct platform_device *pdev) > static int w1_gpio_probe(struct platform_device *pdev) > { > struct w1_bus_master *master; > - struct w1_gpio_platform_data *pdata; > + struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev); > int err; > > - if (of_have_populated_dt()) { > + if (of_have_populated_dt() && !pdata) { > err = w1_gpio_probe_dt(pdev); > if (err < 0) > return err; > + pdata = dev_get_platdata(&pdev->dev); > } > > - pdata = dev_get_platdata(&pdev->dev); > - > if (!pdata) { > dev_err(&pdev->dev, "No configuration data\n"); > return -ENXIO; >