Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp770177pxy; Wed, 28 Apr 2021 13:56:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwI0gmhdR8sv6ZTDl4wDyD2g2ZOIYvQj1j7Uf6CyC/8eME2nK9206UqCyvRZhdRUp7/CX0X X-Received: by 2002:a17:906:90d4:: with SMTP id v20mr31609034ejw.275.1619643374498; Wed, 28 Apr 2021 13:56:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619643374; cv=none; d=google.com; s=arc-20160816; b=EDftEHQM+zvABS8D6Rez17bM2r955k0Qv15HspEhWT3Z5S/SC3YsZgB9yex02Ze731 1DYzBRltDcZIjlinUYYnL8KGI8eImKa9gvfRXb6sNMCWlMtSoWoYyy28NADWGYv+B9GD UbkDdsxOmP9XVgESshz5ttGnfCEQro8CbKPCfncncMaW5dbQ5Rw6gNopRABv8QbKBO5j vjPQNVJcf37OBnaTdxT2ZK1O9yqR4yBU8JHlJGlTdAmWrPrhrIYJ4+LSd/rSNRssn9qv B2ipyyATcG1i+iDyOLeIeMlGB+0bgl//GtjAxEqDIaqMA0WYQMuD66Ap4emRYRfgdZNG KypQ== 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 :dkim-signature; bh=jXcdpJPfYcU4xrGlsY8q2fXpcA/KJpSpEReW1dn7fAo=; b=A9WY47H7IURPBBFTVV73Uvdgp7FzHpBRyH8uHUx5PKhZ6ZUdYzquaWkzArKT7kITGN PgWuqxe5uVnlhxvM9zITSQARNb44aloam8yIOAxmRPNukQnEKQhstS6qXUOgw4VUq7Ix RS9nNFYP4paGQsA0PQ0+Go/ldvCpq++BRlWprRkpS/7tLwYcBhb7122fG45nVvxwwQEX IX3fFKZc8zYl7huYbdNgONjwsVgyoOOP6E5P0V+M0JBHPNlse5BCytfItRUmbronP9ov h1100OfYOjoH1XWgh1UVAiM3VIUuypLszS4QbtfwPfNCb1AlYzIJMKqVDjanospTXzYA vFUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Lusz0mUP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s14si848340edx.141.2021.04.28.13.55.46; Wed, 28 Apr 2021 13:56:14 -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; dkim=pass header.i=@chromium.org header.s=google header.b=Lusz0mUP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243707AbhD1Smb (ORCPT + 99 others); Wed, 28 Apr 2021 14:42:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243709AbhD1Sm1 (ORCPT ); Wed, 28 Apr 2021 14:42:27 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA187C061573 for ; Wed, 28 Apr 2021 11:41:42 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id c3so25587864pfo.3 for ; Wed, 28 Apr 2021 11:41:42 -0700 (PDT) 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=jXcdpJPfYcU4xrGlsY8q2fXpcA/KJpSpEReW1dn7fAo=; b=Lusz0mUPcetH+qgOsw+Wb3zs/WNp1pnW2n6cQLc2fL4KF+wYoxrcrF0H2nKGXuLWCp 9DHAuoux+rOal7YTwuOzVEg3rxnWy/3M3KrKk/O5vhpASJpcIWX7LWSBk7/3QWyuKgZ7 ZC8b7JIFYwWUeuOnRF48MeyrGMuo5wB8zhfhE= 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=jXcdpJPfYcU4xrGlsY8q2fXpcA/KJpSpEReW1dn7fAo=; b=E64sc38+3dW6KoH7M3SnEK+LUyNs0PyK/PLFopvXnbOWkaM/ALIAVZehvptua5kbIm w4RVZY9tcfTXKG6bIW7M2ILqHqfpq6tJEIPQA+XUhVZEPhqV7j8j+xG6ssw9ppyMoVbw bJVHsFfrhugqVnFmX0IhmKMKNbBCje0LyBwfKf7UVcczW9n6xjP408nW9D7sqc97GYpD o3k/Y/JezOkIJpFLCmX8D/bRJQ0wCfmNMVsxWslvArH9K5hGPD6waPooTgeMuTwbS784 mgC4L78Ql3JVT7MeB1JjOui9RCg4m9MdNYOjrPVRw/qIRbYhP0cce39yTZuM20tfE86J KD+w== X-Gm-Message-State: AOAM5309bExSIadJMG9X4Z6/48jj6bQTdkze8VNNmS8HiV4TtItplSNW oJkuGDmNFrzmJX1W2vR9BIF/WQ== X-Received: by 2002:a62:3201:0:b029:211:3dcc:c9ca with SMTP id y1-20020a6232010000b02902113dccc9camr29237178pfy.46.1619635302393; Wed, 28 Apr 2021 11:41:42 -0700 (PDT) Received: from localhost ([2620:15c:202:201:4c1a:a0a7:2b43:81b0]) by smtp.gmail.com with UTF8SMTPSA id q8sm393971pgn.22.2021.04.28.11.41.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Apr 2021 11:41:42 -0700 (PDT) From: Matthias Kaehlcke To: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand Cc: linux-kernel@vger.kernel.org, Ravi Chandra Sadineni , Michal Simek , Bastien Nocera , linux-usb@vger.kernel.org, Douglas Anderson , Krzysztof Kozlowski , Stephen Boyd , devicetree@vger.kernel.org, Peter Chen , Matthias Kaehlcke Subject: [PATCH v8 3/5] of/platform: Add stubs for of_platform_device_create/destroy() Date: Wed, 28 Apr 2021 11:41:30 -0700 Message-Id: <20210428114109.v8.3.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid> X-Mailer: git-send-email 2.31.1.498.g6c1eba8ee3d-goog In-Reply-To: <20210428184132.2184997-1-mka@chromium.org> References: <20210428184132.2184997-1-mka@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Code for platform_device_create() and of_platform_device_destroy() 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 v8: - fixed C&P error in commit message Changes in v7: - none 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, -- 2.31.1.498.g6c1eba8ee3d-goog