From patchwork Tue May 30 16:25:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 9754889 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 25A89602B9 for ; Tue, 30 May 2017 16:29:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1847826538 for ; Tue, 30 May 2017 16:29:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CE9B27CF9; Tue, 30 May 2017 16:29:56 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 9BD7A26538 for ; Tue, 30 May 2017 16:29:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751009AbdE3Q3H (ORCPT ); Tue, 30 May 2017 12:29:07 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:33657 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751184AbdE3Q0x (ORCPT ); Tue, 30 May 2017 12:26:53 -0400 Received: by mail-lf0-f66.google.com with SMTP id m18so9326633lfj.0; Tue, 30 May 2017 09:26: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=Xdb7t9peYp2rvfMvUodeS4CBouRDD7xsqB/lB1+zPGqb90nZH3HUpIPSoQ/xlREKia SvxiwDR42tReCiA8Ui1aM0/Mw/v2ZjYzqq/aqKxKBnpvQDK7Fp3cGgIAgGnkt0brpzdd p77yOO2TZjntmvh3YoFD9VlpZdbAeGebSmGQcYtdstWrhjebBo9FXqFV7fNS9xGTtHY5 qaOv7yTfaCO3yH9Xn/s/2xcqhV8//In+wGWuZqbAFXaHcmdYTL4gqK91IjH1qCSDERTS MUMwCXTeyBYm75MAvhgiINF/318AmZVk01v36l9GHnEN7bDmiIgyEGAxR8kLGvb2mbah iaHQ== 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=py7cl9fnUbTt/dNc4QRt23cq7jNAunQttfjh153qbl+Zi6ilNGOzNGtJGRgRc9YAwN yYv9Jq1gKSFVLZVUBSRYAtMjRUUTxV3cujv7B8svIxC5Nurb059DI/TLQWIhjLTp6uLC gB5bTWgiHuL20o7rszZcS7gYDlsT3B1sQZdt31w02EQ7IkdA1vIJ2GOJFotQPozUp4yn 2VKcZZ8WA0SArP2DRmntjZfDhn/isoBEqdGdn8DEPF7eAzqvpnx94295PwqkQu5uX8Kd 3lL2kw8TNCt6S8NLRo7wDZz8Re6KZBz0qrdrzO9biCee1uKHsPpgNJu7sXqoGcxSCinj YmgA== X-Gm-Message-State: AODbwcCzEvtF2dbvsZSX3K0z2AJUcq2D+OAmT6Fmlzi0WYdsaxUG8vA5 6BQWpwohyxy2Pw== X-Received: by 10.25.16.219 with SMTP id 88mr6433339lfq.134.1496161610950; Tue, 30 May 2017 09:26:50 -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 26sm2797920ljt.30.2017.05.30.09.26.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 May 2017 09:26:47 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.89) (envelope-from ) id 1dFjyr-0006pI-II; Tue, 30 May 2017 18:26:49 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Linus Walleij , Peter Chen , Rob Herring , Arnd Bergmann , Sricharan R , Zhang Rui , Eduardo Valentin , linux-pm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Laxman Dewangan Subject: [PATCH 7/7] thermal: max77620: fix pinmux conflict on reprobe Date: Tue, 30 May 2017 18:25:54 +0200 Message-Id: <20170530162554.26159-8-johan@kernel.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170530162554.26159-1-johan@kernel.org> References: <20170530162554.26159-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);