Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp371772ybz; Tue, 21 Apr 2020 10:37:23 -0700 (PDT) X-Google-Smtp-Source: APiQypIyb1bw2jNFiZ03uNWS0kthuuEZfglrP12WAERq8soy31ulBMbBhzyXQvINP8e8OoZa4U/L X-Received: by 2002:a17:906:2418:: with SMTP id z24mr21945512eja.42.1587490643109; Tue, 21 Apr 2020 10:37:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587490643; cv=none; d=google.com; s=arc-20160816; b=wJwTNH71rQK6BvYwL6XJ+JPkLI+WS7SNg0bosJmhiREMWCiFbvf1Ewmf1BE+hlCjiI F/0IpZahWIei/CC8Oqevd7lJetD7YUVt6q39AzDdeZDFXgzHT9PZPL2dLcgxnHIgvfRy fwE0e7N01rYhrcRCByqFDnxLA0mkfR4OkRV+Qhh/04l53VE3Jk2QVtJku1vyfQWl1PLt By2qeUIWcpnjz/2MMV8Wao8mpM6YlVo92lssMEJQCo0kJDWsXJRGKt9c0g+Ah3kDxk/9 ZbLnQtJ8TLRwccWIWCuqGeMg87wnCJnPTCp3SBIinAjdGitbOw14V84C677UJXyG2kDg jQ0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=OHWbAE1bSUASLzaJUezmgtIWLqoHJhDDqHgPRCxjlqU=; b=kK3jdi0krW5SiRv/K5tmey1XhAkW6/GPU6gYeJxyDa7rZk859U1Ltj0sYO7FjaLmqE JoZS6l++Fz3uiH5B8mYd9p1NJOf0kEXKvxXNXcH61nfWsSI8Ne4Kna1HF3E7FoPP5gtq ZMAtOIWCDbASsgF2WPtyQTCifdvw2LhjLMTALu4Kf9FJWUrEyxXQ3kdAT2mR/yQ37Msj sChaxqkD/6WWjem5qmAuQVR8MGxBt3Jn9Xet3dD55JT8df1DWQhyIWxU/mdKPnss8pyi SBwlKO5bEleYNjGUVvf6h44qNVFMfuaXFGXaVZH26v1dP1DzPjTgtpMXN2XbmBzLVwPk pYOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r28si86061edw.570.2020.04.21.10.36.59; Tue, 21 Apr 2020 10:37:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728422AbgDURdD (ORCPT + 99 others); Tue, 21 Apr 2020 13:33:03 -0400 Received: from foss.arm.com ([217.140.110.172]:38940 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725930AbgDURdC (ORCPT ); Tue, 21 Apr 2020 13:33:02 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 52CA61FB; Tue, 21 Apr 2020 10:33:02 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B5D2D3F73D; Tue, 21 Apr 2020 10:33:01 -0700 (PDT) From: Sudeep Holla To: Richard Gong , linux-kernel@vger.kernel.org Cc: Sudeep Holla Subject: [PATCH] firmware: stratix10-svc: Drop unnecessary checking for and populating /firmware/ node Date: Tue, 21 Apr 2020 18:32:56 +0100 Message-Id: <20200421173256.34897-1-sudeep.holla@arm.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 3aa0582fdb82 ("of: platform: populate /firmware/ node from of_platform_default_populate_init()") changed the core-code to generate the platform devices, meaning there is no need for the driver to check the firmware node and populate it again here. Let us just drop the unnecessary extra check done here as the core takes care of it. Cc: Richard Gong Signed-off-by: Sudeep Holla --- drivers/firmware/stratix10-svc.c | 17 ----------------- 1 file changed, 17 deletions(-) Hi Richard, I assume the subsys_initcall is essential here. If not we can remove the whole initcalls and replace it with module_platform_driver(). Let me know. Just found this by accident when grepping for something else. Regards, Sudeep diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c index d5f0769f3761..791d70fe82c1 100644 --- a/drivers/firmware/stratix10-svc.c +++ b/drivers/firmware/stratix10-svc.c @@ -1094,23 +1094,6 @@ static struct platform_driver stratix10_svc_driver = { static int __init stratix10_svc_init(void) { - struct device_node *fw_np; - struct device_node *np; - int ret; - - fw_np = of_find_node_by_name(NULL, "firmware"); - if (!fw_np) - return -ENODEV; - - np = of_find_matching_node(fw_np, stratix10_svc_drv_match); - if (!np) - return -ENODEV; - - of_node_put(np); - ret = of_platform_populate(fw_np, stratix10_svc_drv_match, NULL, NULL); - if (ret) - return ret; - return platform_driver_register(&stratix10_svc_driver); } -- 2.17.1