From patchwork Sun May 23 02:28:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 446601 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7654C47081 for ; Sun, 23 May 2021 02:28:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E5776120D for ; Sun, 23 May 2021 02:28:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231534AbhEWC3e (ORCPT ); Sat, 22 May 2021 22:29:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231513AbhEWC3e (ORCPT ); Sat, 22 May 2021 22:29:34 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1432C061574; Sat, 22 May 2021 19:28:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=P6dTj6mWdxmlGaygBBC5NRc0NUr0pdfgGLiOJPkt8mM=; b=UFYXTWfHlfwiNHyKhOTlrEe+hq XgIdPHrTLUwhi3I1yGUJtcII6VWvxwF44cUCD8nGdjeKc4hvq5cKNwK/xqblasLq0pWVGjKb4FvTC o/gHjzJLEr6UBgk6fSKtUutaKGS6enHr9jU+R1JdSTnHA1qnRCkB0ziVUhhpurJQD2/c9IuuoWYUF 2Q4ivKeBY/XbZX4aXQQ7qhcz+zKtrWZg4sCVyGnx1xJVfR+xu/AVob5TSgAEhJYSPTxOW6R+hsGVR TQU+mEA8txDJcm7tbMnm1r0eCTWITavWd6zqn9QRiGEOE5SQWGM36Tx37cZ20HuL359H4egVL7jGb g9DS9zwA==; Received: from [2601:1c0:6280:3f0::7376] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lkdqa-000HWL-06; Sun, 23 May 2021 02:28:08 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Rob Herring , Frank Rowand , devicetree@vger.kernel.org, Laurent Pinchart Subject: [PATCH] OF: of_address: clean up OF stub functions Date: Sat, 22 May 2021 19:28:07 -0700 Message-Id: <20210523022807.5193-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Adjust so that stubs are present when CONFIG_OF is not set *or* OF is set but OF_ADDRESS is not set. This eliminates 2 build errors on arch/s390/ when HAS_IOMEM is not set (so OF_ADDRESS is not set). I.e., it provides a stub for of_iomap() when one was previously not provided as well as removing some duplicate stubs. s390-linux-ld: drivers/irqchip/irq-al-fic.o: in function `al_fic_init_dt': irq-al-fic.c:(.init.text+0x7a): undefined reference to `of_iomap' s390-linux-ld: drivers/clocksource/timer-of.o: in function `timer_of_init': timer-of.c:(.init.text+0xa4): undefined reference to `of_iomap' Tested with many randconfig builds, but there could still be some hidden problem here. Fixes: 4acf4b9cd453 ("of: move of_address_to_resource and of_iomap declarations from sparc") Signed-off-by: Randy Dunlap Cc: Rob Herring Cc: Frank Rowand Cc: devicetree@vger.kernel.org Cc: Laurent Pinchart --- include/linux/of_address.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) --- linux-next-20210521.orig/include/linux/of_address.h +++ linux-next-20210521/include/linux/of_address.h @@ -106,11 +106,7 @@ static inline bool of_dma_is_coherent(st } #endif /* CONFIG_OF_ADDRESS */ -#ifdef CONFIG_OF -extern int of_address_to_resource(struct device_node *dev, int index, - struct resource *r); -void __iomem *of_iomap(struct device_node *node, int index); -#else +#if defined(CONFIG_OF) && !defined(CONFIG_OF_ADDRESS) || !defined(CONFIG_OF) static inline int of_address_to_resource(struct device_node *dev, int index, struct resource *r) {