Received: by 10.223.185.116 with SMTP id b49csp2909876wrg; Sun, 18 Feb 2018 09:20:51 -0800 (PST) X-Google-Smtp-Source: AH8x226ia3mWcupTZ6XpFffOCwqJmnxb+3LEiuWuG1IF6IhBdrCcfdYI+znfyNviDtgrnzUT9gds X-Received: by 10.101.71.202 with SMTP id f10mr2831943pgs.91.1518974450925; Sun, 18 Feb 2018 09:20:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518974450; cv=none; d=google.com; s=arc-20160816; b=QFN72cXrnDQZaan+nKz9jAT4av5fusiBD+Te6VodgNoNLt0DtOT9yFnIWRH5Ii9Bei h62tMo9KJR/pIMQsodpC5cMEB5z70KMqU0BzoOTdhUqOweT4EO5ZQN+JgnU/V8ihNkVo h/1YdFu9qjtmv7OqKx7P3M7lJDOmHDaWcJKtZzRQg86qnH5asNIF0qil8Ng7JRrRruTi J8jq1ubcdvevTgM2fc3VP1bPinr2DrED2ALhNVDebAyr4dpwbQxSMp2ZRhnfBFTNLBYQ oA60IHSAchaVzU0szNeIbyBP3IEnMUF9oanQnf1cRYQZ/ogHImFYwyfxKWUn9pCrYjrI yidg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:in-reply-to:message-id:date :subject:cc:from:dkim-signature:arc-authentication-results; bh=Z+B63DvkiYvWvlZ1hMt5E72mHR3hPrkiziJpYiDk8tU=; b=ZPP31kCEuBgW82HomgOGqSZRM8ZCnSZvdzrCDDLKigKxKb6u3EMpD5wiHfjPyXiiLr FinKGj7cTi1GUykI/7/2VEDOmtJnFNZDnxg+Y1vy45uRBDx0e6d7yCm5A2Kf4PT3e8/7 wmbAiLN7SRD+j+ughU001Gjn4uJrTp86T6jGrG8ezsMRyLvvcddd0PQRNCkXlK//Td+9 8mkFGNcCtfim08QDYdXjNhcawEIhgMYkwWDnb++sT4kP1g8ImD3Yy/BPmwszHsxoO1BZ fX0UpZ5/fiV662x3EWDsfgjId4A+ClaTIFOpo4/yZ50xKYdrPO9XRCof5nXJ3LTlS9+Q FfZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Qv8fXBM+; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w123si3125659pfd.285.2018.02.18.09.20.36; Sun, 18 Feb 2018 09:20:50 -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=fail header.i=@gmail.com header.s=20161025 header.b=Qv8fXBM+; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751477AbeBRRT5 (ORCPT + 99 others); Sun, 18 Feb 2018 12:19:57 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:44240 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751259AbeBRRTz (ORCPT ); Sun, 18 Feb 2018 12:19:55 -0500 Received: by mail-lf0-f67.google.com with SMTP id v9so8110120lfa.11; Sun, 18 Feb 2018 09:19:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z+B63DvkiYvWvlZ1hMt5E72mHR3hPrkiziJpYiDk8tU=; b=Qv8fXBM+ugw4O4vW0/POVZPSzU/4S1KK/9DCOA/PnTDaCqX4TUPePTG+rjJtKskvAl exumxrGPSQZ0mNvpmsTgppdxoxl+1Gwe/7PoDVyq31rrvgzB9iNvM0StKfGBHrG96f0n b1OuJ+srYPCTXVDESc3bzltNIoJTDyakkXr2BBuQk1nMlILHHwewdFjTUxZpd/DMjock IWQHhrriwWnxyaWECwz0KY/JDMJ0C5gWt3MVU33nx6CSJmXxIkobtKTMuVand1js7Kxc 7VzoWy1mrJppnEscpj8yhT/lOqrmPiUKcXEjc75PHy2x6bhZScEqZoCZn68nMX12Y/1y 7hPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Z+B63DvkiYvWvlZ1hMt5E72mHR3hPrkiziJpYiDk8tU=; b=Le5uNTJSIYc2U010TUubKRzVjbbK/JyXrZUtK6axrUg+JZXUTgRTQXcod85fsZnHgD PRP+RXgI8M5t9okr5/T+//pLDhDEnfgklGawQFm1bgFAE72hYxrGhsuXWtC8jXBg+fIu fZWhM8x1AZS/Jh8f+Tj7Ok/IzvvbIJdqEIw7WiG7e6CHbEy0kyN9Fvyrur5IWpYZwmfJ ICBcMmxjeK8Uaf19IgTtGxrU56/ZNblaPz6wjOroOyGCRBFvz99wH4l97zYB2Ql52MBJ BIxY4SThVsvi64cMF2qedOs56hVzr49JzAu06U6V84WDQvSsSA9e4lBIaiDkUHJrURNE 4sKg== X-Gm-Message-State: APf1xPBKMRuix+Cz+XBf7sAC40fDE9T02tIaLLongYaPwRrhXMFEB8v2 Jdtxhg5R6OJd/gN4ZLSXmCrLvsKM1Uw= X-Received: by 10.25.24.203 with SMTP id 72mr8055955lfy.132.1518974393717; Sun, 18 Feb 2018 09:19:53 -0800 (PST) Received: from ubuntu-VirtualBox.lan ([91.238.216.6]) by smtp.googlemail.com with ESMTPSA id r3sm837266lje.96.2018.02.18.09.19.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Feb 2018 09:19:53 -0800 (PST) From: Pawel Dembicki Cc: stable@vger.kernel.org, Pawel Dembicki , Evgeniy Polyakov , "Andrew F. Davis" , Sebastian Reichel , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: [PATCH] w1: gpio: fix problem with platfom data in w1-gpio Date: Sun, 18 Feb 2018 18:19:26 +0100 Message-Id: <20180218171927.6414-1-paweldembicki@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180218170629.6045-1-paweldembicki@gmail.com> References: <20180218170629.6045-1-paweldembicki@gmail.com> To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.14.1