From patchwork Wed Jan 8 13:49:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 205987 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=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 47651C282DD for ; Wed, 8 Jan 2020 13:49:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 21A4620692 for ; Wed, 8 Jan 2020 13:49:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727498AbgAHNto (ORCPT ); Wed, 8 Jan 2020 08:49:44 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:54747 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727158AbgAHNto (ORCPT ); Wed, 8 Jan 2020 08:49:44 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1MUGmJ-1jFpMw3wu3-00RIIe; Wed, 08 Jan 2020 14:49:38 +0100 From: Arnd Bergmann To: Rob Herring , Frank Rowand , Kishon Vijay Abraham I , Jyri Sarha Cc: Arnd Bergmann , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [v2] of: add more dummy helper functions Date: Wed, 8 Jan 2020 14:49:28 +0100 Message-Id: <20200108134936.3617013-1-arnd@arndb.de> X-Mailer: git-send-email 2.20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LQQqDlWXZHnV56TDMv83UCeijBgoUkbgT6qr6X3PMU2cDfAqL/q 8L7JtdN+u9EWyJPelSangHh88Pw2FI1UY8wCMbACpijNVF9l2xqYYCd5Z0uqKaqrsEv0aKF/d bdmh3RFFZmZUSA4cFL8Q== Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The new phy-j721e-wiz driver causes a link failure without CONFIG_OF: drivers/phy/ti/phy-j721e-wiz.o: In function `wiz_remove': phy-j721e-wiz.c:(.text+0x40): undefined reference to `of_platform_device_destroy' Add a dummy version of of_platform_device_destroy to avoid having to add Kconfig dependencies for the driver. As there are a few other functions without dummy implementations, add those as well for completeness. Fixes: 42440de5438a ("phy: ti: j721e-wiz: Add support for WIZ module present in TI J721E SoC") Signed-off-by: Arnd Bergmann --- include/linux/of_platform.h | 39 ++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 84a966623e78..f5dea3de4856 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -48,28 +48,49 @@ struct of_dev_auxdata { extern const struct of_device_id of_default_bus_match_table[]; +#ifdef CONFIG_OF /* Platform drivers register/unregister */ extern struct platform_device *of_device_alloc(struct device_node *np, const char *bus_id, struct device *parent); -#ifdef CONFIG_OF extern struct platform_device *of_find_device_by_node(struct device_node *np); -#else -static inline struct platform_device *of_find_device_by_node(struct device_node *np) -{ - return NULL; -} -#endif - /* Platform devices and busses creation */ extern struct platform_device *of_platform_device_create(struct device_node *np, const char *bus_id, struct device *parent); - extern int of_platform_device_destroy(struct device *dev, void *data); extern int of_platform_bus_probe(struct device_node *root, const struct of_device_id *matches, struct device *parent); +#else +static inline struct platform_device *of_device_alloc(struct device_node *np, + const char *bus_id, + struct device *parent) +{ + return NULL; +} +static inline struct platform_device *of_find_device_by_node(struct device_node *np) +{ + return NULL; +} +static inline struct platform_device *of_platform_device_create(struct device_node *np, + const char *bus_id, + struct device *parent) +{ + return NULL; +} +static inline int of_platform_device_destroy(struct device *dev, void *data) +{ + return 0; +} +static inline int of_platform_bus_probe(struct device_node *root, + const struct of_device_id *matches, + struct device *parent) +{ + return -ENODEV; +} +#endif + #ifdef CONFIG_OF_ADDRESS extern int of_platform_populate(struct device_node *root, const struct of_device_id *matches,