From patchwork Tue Jun 6 15:59:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 9769227 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3951160364 for ; Tue, 6 Jun 2017 16:03:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4265E22B1F for ; Tue, 6 Jun 2017 16:03:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 358DB2843F; Tue, 6 Jun 2017 16:03:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C521E22B1F for ; Tue, 6 Jun 2017 16:03:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751574AbdFFQC2 (ORCPT ); Tue, 6 Jun 2017 12:02:28 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:33177 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751543AbdFFQAx (ORCPT ); Tue, 6 Jun 2017 12:00:53 -0400 Received: by mail-lf0-f68.google.com with SMTP id u62so11922890lfg.0; Tue, 06 Jun 2017 09:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=LK4/MNZWuRx8ftpczvdKWomLiL7x1yqI0PTDLVnD1p4=; b=kf+FS3j3NbJElBHHtwiZ8oIrTqLevY1f8O3/Lj+1GttMmVdUTVzsSmYwwiA3SlyetA zfe0SdZKleCu3wDA+E4OnMKIZCqZkniyjlmaSsv4zqt+ja5Fxl9r6eeWcDcwReGs3/qC UUBqA2raj/Jo6lj7pm5aqyNR1fbltHhbPS4oeZvPPAbwbd3iikbUF+KuBJrEfWfkQxbS 0OkhO6Rwio2fr1+F1jQq7lRI8Lw9rth8view5bfSAZz2HZQzXChyjpDmRtjhI/TK6Tcv qB+yS2QK5qiLZchNgcw/mEGP0mv3oCZvhQZN/ejzoIeiWpvNxboCvYypcwkOzxHLQSr6 5Gug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=LK4/MNZWuRx8ftpczvdKWomLiL7x1yqI0PTDLVnD1p4=; b=XVBQCm4Ky5TXDRsuSJbY1yIqqM+vQ5HAxTNc70iqqdFi/YI5PFJz0KDzbmqSMpKXyI QNGNm/TnHsysdUhBjl29FVNRy2S+mx5ecC802IBZHG5o67wh8iCtMm8Y4BgzNo8lRtoz NCyI4gR0h3y7G04Zq6uGEORFHD6/4vfO4OI7IWI8z2POtRM/u4QVrio/RQdMQQtYKAsg AulatTGIaFAMT0eZuKXaC2U+wU7/rnFLe7O6ric/KHh9lNA2Ol5qisbw43pw38Pt4EcT c03Eb/bq4V5CVQ9uNl5fUNg5G2yZPzUIpcLUNLRSzpKu16BhMc6A68Nx7/T1FbuT/xzi FGfw== X-Gm-Message-State: AODbwcDOd5E5X4/44180XLLTv0xOoRKYi9EfoDwOjT0p6uRJK2DBsV+o 8JPSVVE+7v7IKg== X-Received: by 10.25.44.208 with SMTP id s199mr6667980lfs.180.1496764851275; Tue, 06 Jun 2017 09:00:51 -0700 (PDT) Received: from xi.terra (c-42c8e255.07-184-6d6c6d4.cust.bredbandsbolaget.se. [85.226.200.66]) by smtp.gmail.com with ESMTPSA id j5sm7665432lfe.68.2017.06.06.09.00.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Jun 2017 09:00:47 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.89) (envelope-from ) id 1dIGuV-00071U-5s; Tue, 06 Jun 2017 18:00:47 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Linus Walleij , Peter Chen , Rob Herring , Arnd Bergmann , Sricharan R , Zhang Rui , Eduardo Valentin , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-usb@vger.kernel.org, Johan Hovold , Laxman Dewangan Subject: [PATCH v2 7/7] thermal: max77620: fix pinmux conflict on reprobe Date: Tue, 6 Jun 2017 17:59:04 +0200 Message-Id: <20170606155904.26819-8-johan@kernel.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170606155904.26819-1-johan@kernel.org> References: <20170606155904.26819-1-johan@kernel.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the new helper for reusing a device-tree node of another device instead of managing the node references explicitly. This also makes sure that the new of_node_reuse flag is set if the device is ever reprobed, something which specifically now avoids driver core from attempting to claim any pinmux resources already claimed by the parent device. Fixes: ec4664b3fd6d ("thermal: max77620: Add thermal driver for reporting junction temp") Cc: Laxman Dewangan Signed-off-by: Johan Hovold --- drivers/thermal/max77620_thermal.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/max77620_thermal.c b/drivers/thermal/max77620_thermal.c index 71d35f3c9215..159bbcee8821 100644 --- a/drivers/thermal/max77620_thermal.c +++ b/drivers/thermal/max77620_thermal.c @@ -112,12 +112,10 @@ static int max77620_thermal_probe(struct platform_device *pdev) } /* - * Drop any current reference to a device-tree node and get a - * reference to the parent's node which will be balanced on reprobe or - * on platform-device release. + * The reference taken to the parent's node which will be balanced on + * reprobe or on platform-device release. */ - of_node_put(pdev->dev.of_node); - pdev->dev.of_node = of_node_get(pdev->dev.parent->of_node); + device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); mtherm->tz_device = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, mtherm, &max77620_thermal_ops);