From patchwork Fri Mar 5 19:38:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 394679 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.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 D4A7EC43333 for ; Fri, 5 Mar 2021 19:39:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B5919650BC for ; Fri, 5 Mar 2021 19:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbhCETjK (ORCPT ); Fri, 5 Mar 2021 14:39:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229969AbhCETjG (ORCPT ); Fri, 5 Mar 2021 14:39:06 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1B5FC061761 for ; Fri, 5 Mar 2021 11:39:06 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id t9so2463527pjl.5 for ; Fri, 05 Mar 2021 11:39:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JB6kdr5tZpshWCy8V9QYmlDg00VbremNU/eNtnae9YQ=; b=klVphLhascJXjUnHD8FEDvvYZa+HqIWAzGHfuwOX0XJPnOdtMPCk7cRWEW+CQMtQSP JK77Fs6uUJLPFWJy4wjbLYEfc+qfzUpNP/VcZlV5AzGgfCWHVy2pObQ6JLG9/q88eF0Q mJvqUNRASQntYXH2Dpzlw2B8dfQyEaexrB3Jo= 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=JB6kdr5tZpshWCy8V9QYmlDg00VbremNU/eNtnae9YQ=; b=qT397ZPvbUz+g0Ui8RHYaxsU5K+uxf4wwWVskdKpYuHKl7sgdJ1xWQLry2F7elQvH/ wuGtqqV1AK3KK/igN14mOBn9aCij3/A9SP6xVnzEZF2q/rxDDOM49cQTT+GdATuo/2f5 tG4Z1kFC1/G7wAixX0pZWTGEXxkv459UqOL8wnTsb8nTGySBTUpgbWPSee6cZ3temcMA ED51yZ9UpBMK7yeLuCMxP+4wVJ5TARgXViinY9DatzDdvSrqG9QfaqszesRUadEH+aH/ 96Us2iGA11aifGx4fqHEMf8TE2BF7RwJgtrWxqmiAeK6EDVO1gGJBkdZAlX9Hsu61Z6m 1Jnw== X-Gm-Message-State: AOAM531yqvOOlZHV++GktEoPx+/udwrb307S2HMalM72yRimdmhc1e3Z YitWuzj/h1DY6VhooZ1F7/Qt3w== X-Google-Smtp-Source: ABdhPJxna8HSJsU74R2/mecjb+RJE4MHeJcu0zzhDLZkEkzRExlGOIoPRv2UzRiNz7lyWLi302bEBQ== X-Received: by 2002:a17:90b:92:: with SMTP id bb18mr11533435pjb.40.1614973146376; Fri, 05 Mar 2021 11:39:06 -0800 (PST) Received: from localhost ([2620:15c:202:1:2878:25d1:94cb:a547]) by smtp.gmail.com with UTF8SMTPSA id y15sm3960837pgi.31.2021.03.05.11.39.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Mar 2021 11:39:06 -0800 (PST) From: Matthias Kaehlcke To: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand Cc: Ravi Chandra Sadineni , Peter Chen , Michal Simek , Stephen Boyd , linux-kernel@vger.kernel.org, Bastien Nocera , linux-usb@vger.kernel.org, Douglas Anderson , devicetree@vger.kernel.org, Krzysztof Kozlowski , Matthias Kaehlcke Subject: [PATCH v6 3/5] of/platform: Add stubs for of_platform_device_create/destroy() Date: Fri, 5 Mar 2021 11:38:51 -0800 Message-Id: <20210305113832.v6.3.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210305193853.2040456-1-mka@chromium.org> References: <20210305193853.2040456-1-mka@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Code for platform_device_create() and of_platform_device_create() is only generated if CONFIG_OF_ADDRESS=y. Add stubs to avoid unresolved symbols when CONFIG_OF_ADDRESS is not set. Signed-off-by: Matthias Kaehlcke --- Changes in v6: - patch added to the series include/linux/of_platform.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 84a966623e78..d15b6cd5e1c3 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -61,16 +61,18 @@ static inline struct platform_device *of_find_device_by_node(struct device_node } #endif +extern int of_platform_bus_probe(struct device_node *root, + const struct of_device_id *matches, + struct device *parent); + +#ifdef CONFIG_OF_ADDRESS /* 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); -#ifdef CONFIG_OF_ADDRESS + extern int of_platform_populate(struct device_node *root, const struct of_device_id *matches, const struct of_dev_auxdata *lookup, @@ -84,6 +86,18 @@ extern int devm_of_platform_populate(struct device *dev); extern void devm_of_platform_depopulate(struct device *dev); #else +/* Platform devices and busses creation */ +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 -ENODEV; +} + static inline int of_platform_populate(struct device_node *root, const struct of_device_id *matches, const struct of_dev_auxdata *lookup,