From patchwork Thu Feb 11 22:25:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 381052 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp2454376jah; Thu, 11 Feb 2021 14:27:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXnChMGpbpkKJPr/+m1m4j4s9mFUvVmJyvlNwbKn7bIhg0N/k0DHbu6IpP6a8cMJ7967Di X-Received: by 2002:aa7:d1da:: with SMTP id g26mr330540edp.154.1613082454386; Thu, 11 Feb 2021 14:27:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613082454; cv=none; d=google.com; s=arc-20160816; b=HqaCkeN7jtgUnTmJTGz1wdtLnpL3jzaU59hkkt5+394RCcuWLAVemVLb4S+S160vgF wRw6TayyRK2aCbJb5c5imyrMVFuHAUTvcPOUgjz46YX4nMC8ZkFeaG8onMlNdkqMEMYa S2Fc18owx7fngMSRFCXYbKg4TH1X1nFCIgOulN7Qmxh91heurmzzdnVssiuScbuJHw5r N8bPPrHxZ0cUhogQeis7d8Zu2KDXIEM523y0nX51LZ+SCgd9L0Ylf5UlzWbvKsOjwQ+p +tCdPxmXqSW8f88R/tO4dXNxuP9UP6TIoiqPwpluHRh67ESbe9F8BQzE32W54CdM4fd+ mgNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=59hf+6O4K21P81t02yR2JJsizjTVRLh6ZVSrQljA/sc=; b=EhvAibO4V3WYXdWI1QsN9m/PFvqBHT5xGCNiQBWd7hd9+vjX/b/DIdf0qXUsci9y0C skSdqgAv0Am2cOdWvhG4BPV6WGQECgU4TGy3a3hh3BEVjEgdMs7qSVNdELSanxjy9Npm HtZwqH53plA+Zvk9Ad0Awv13InkNn/r2uBQysNfKofSvlm7lmoVLDDsGsW/QfIiZG5MN S3P1mIYA/60MZmusaMBaVI6GOA/2zJVjenvKrl24JWerJNMAy2EPGXkN2UR103rirV2J LUtYhiKC+i44BiUhgsbu1IaTfhbuKX7wL9HXNsdMAMMaCO1AqxAcmfgVocNnOyey3dzm SP0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cm20si4406769edb.371.2021.02.11.14.27.34; Thu, 11 Feb 2021 14:27:34 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230018AbhBKW0W (ORCPT + 6 others); Thu, 11 Feb 2021 17:26:22 -0500 Received: from mail-ot1-f45.google.com ([209.85.210.45]:37775 "EHLO mail-ot1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229951AbhBKW0P (ORCPT ); Thu, 11 Feb 2021 17:26:15 -0500 Received: by mail-ot1-f45.google.com with SMTP id a5so5543912otq.4; Thu, 11 Feb 2021 14:25:59 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=59hf+6O4K21P81t02yR2JJsizjTVRLh6ZVSrQljA/sc=; b=PzeLWQRKM5kVo8msW/nlweGOtaCQktFulmgltCVNpy/Ty6+hE70jqhjM7KQ9cCG24W OqtQupMTrOnCzUNpu3aoIAT75z9ugth1irgQgkh1HG0Pc+zAsoY4AvRHZIcm9uD3brOc qd0z+W7xzpFHLHnSa+dwFreKoR6LIuUoZ+zXNq+ZuLZwtxiBanYFcmWC5B1kgN8X80CQ 85ZmHNal9LfELmtxUezz6qAGKSS76Zr/jo1KIbsXVeSbdF+rGgXBZHzVcAaOgbCEJHN5 244x4Egh8bpwwOLcxszeUCJvVDciM26KEeJkW8VA4+3s3WA3UyEQtqWtEnajnYrq3X0Y YSZA== X-Gm-Message-State: AOAM532xjRPyDILmadSj6dkPhmunrHaZ24dO+J+SkH8XSI+6tWFx/9it T1cDfFCJ+UmaFADbSkYPAQ== X-Received: by 2002:a9d:605a:: with SMTP id v26mr136880otj.275.1613082333675; Thu, 11 Feb 2021 14:25:33 -0800 (PST) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id j25sm978030otn.55.2021.02.11.14.25.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 14:25:32 -0800 (PST) From: Rob Herring To: Michael Ellerman , Greg Kroah-Hartman , "David S. Miller" , Jakub Kicinski , Frank Rowand , devicetree@vger.kernel.org Cc: Paul Mackerras , "Rafael J. Wysocki" , Patrice Chotard , Felipe Balbi , Julia Lawall , Gilles Muller , Nicolas Palix , Michal Marek , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, cocci@systeme.lip6.fr, Benjamin Herrenschmidt Subject: [PATCH 2/2] driver core: platform: Drop of_device_node_put() wrapper Date: Thu, 11 Feb 2021 16:25:26 -0600 Message-Id: <20210211222526.1318236-3-robh@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210211222526.1318236-1-robh@kernel.org> References: <20210211222526.1318236-1-robh@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org of_device_node_put() is just a wrapper for of_node_put(). The platform driver core is already polluted with of_node pointers and the only 'get' already uses of_node_get() (though typically the get would happen in of_device_alloc()). Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Frank Rowand Signed-off-by: Rob Herring --- drivers/base/platform.c | 2 +- include/linux/of_device.h | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) -- 2.27.0 diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 95fd1549f87d..c31bc9e92dd1 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -571,7 +571,7 @@ static void platform_device_release(struct device *dev) struct platform_object *pa = container_of(dev, struct platform_object, pdev.dev); - of_device_node_put(&pa->pdev.dev); + of_node_put(&pa->pdev.dev->of_node); kfree(pa->pdev.dev.platform_data); kfree(pa->pdev.mfd_cell); kfree(pa->pdev.resource); diff --git a/include/linux/of_device.h b/include/linux/of_device.h index d7a407dfeecb..1d7992a02e36 100644 --- a/include/linux/of_device.h +++ b/include/linux/of_device.h @@ -38,11 +38,6 @@ extern int of_device_request_module(struct device *dev); extern void of_device_uevent(struct device *dev, struct kobj_uevent_env *env); extern int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env); -static inline void of_device_node_put(struct device *dev) -{ - of_node_put(dev->of_node); -} - static inline struct device_node *of_cpu_device_node_get(int cpu) { struct device *cpu_dev; @@ -94,8 +89,6 @@ static inline int of_device_uevent_modalias(struct device *dev, return -ENODEV; } -static inline void of_device_node_put(struct device *dev) { } - static inline const struct of_device_id *of_match_device( const struct of_device_id *matches, const struct device *dev) {