Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3946894pxj; Tue, 11 May 2021 15:56:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhtvFAYXvyjDO6ktcbwLB9lhl5yN41nwdYgaOyynQEV0TwMeGtp2K0/O3gvbZGzrys1wnX X-Received: by 2002:a05:6402:b88:: with SMTP id cf8mr39443443edb.227.1620773773137; Tue, 11 May 2021 15:56:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620773773; cv=none; d=google.com; s=arc-20160816; b=v4Ijwc8m+/w/CzGipi8CA+1T6HN2FC37Gnr+iBsMZr+dVgr8Ykmi4tbxQPyHman6MU 8wbbvgI/biWwC88Bq6Xe2IhPSqA8UP3z9NmPGKFCnR0BJuNbF3FqQIpUc0lSReUqXlUY cVO4xD9hy23BeJMYmGwOda9bEeMyp8VG7ftG5R/Tj9WW8jjpoJxkm1yfjeEkKf7ZMPO0 3yY6+3qhDIVi5vwuDrX4W6zL9+NtnH4spmqDgK+2ErYZ3siKIdiYj/g8vFG9q9n0/zsH xDBQaDf7H0iPN235fgaTqldsWEaIF9otPB/Zs4+9JVKpq7NCuAbw7tRXj7QeqKkHtCWg bQvA== 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=8aKnVtIxlUG/2eUQmNl0qPhaQg9l3TplAhr5B7EOd6U=; b=0pykZtOvaOt0zXWssRcNe0diLsAG8YCgFM1hyqMHIz+DuTOaMcv8l71p1q5iKenQH+ QMtBh8VUeiofaNW0rZoNFfmwR6rBpPbxVOMi5ni3ipDKjCYfC5Y1BEqVf8i8KiNTzWrz hahOpNL2XsgtxrmHjetVqhvY1I8lIsT6zYWQEU++3Ug8L5Rs/6jiiH+ULPBoCe6v9gg3 aNWd4QagPokdfRsS/vTUYmoiczgAnKU/YRRpO5EqcGRRp24K4I7IHINCnt9bG+lwTIw0 7aGzo++E24v9Af+Gr6xvL5gblrp4oRFhZLNu3R9Zum0DYzrk8hLBHuiRsiS5agLpXQ8m m3AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LvzERiai; 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 s5si18270544eju.297.2021.05.11.15.55.49; Tue, 11 May 2021 15:56:13 -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=LvzERiai; 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 S230247AbhEKWxp (ORCPT + 99 others); Tue, 11 May 2021 18:53:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230183AbhEKWxl (ORCPT ); Tue, 11 May 2021 18:53:41 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28D5BC06138A for ; Tue, 11 May 2021 15:52:33 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id c21so16812139pgg.3 for ; Tue, 11 May 2021 15:52:33 -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=8aKnVtIxlUG/2eUQmNl0qPhaQg9l3TplAhr5B7EOd6U=; b=LvzERiaiALvJFXjzftXoHUCyKmzQ4UBbwHeONAJXlRmCEFlO7I1pPQBoo51KsymSOC izVUQGDqJF43p1PMQqu3RTbUEknJP2LEoPusHVkm35IFDHE1EcXzm+DDGZ9PnIg4GVln ZePnFPrFMA0JsA1+JnW4vWXx0HQ5ISkwnuUXg= 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=8aKnVtIxlUG/2eUQmNl0qPhaQg9l3TplAhr5B7EOd6U=; b=r+DH7nC6lEEiNkMd3Tt6CUSRDS4Q4E+FDlQJ5qlQSUesaWuCRwwF5IMjhrYP4L9eEE KZGRq0kLD0rTrPBZ77CVxSNLBZ+xjr0+3R75+faBuQOx0Wh9UTy2q90TcnhqWPvUoKbY fBSGEtd5O4JXXtX7JIpLQpkru54x9uoUqOD4kbNL9vCTWog9WZwzM+qipmGtnfDfTn9Y k9r/UBHN0MG+oNhbBloYTkqsCLDTDLKOsp+X1etS/PYTx0yCkRWAISjKVA0OvWBZTXx1 KrGKgOjdoZkKFsmIVu0k5tiJXVyxIBU2AG4UkLXv5nb+safAwz+3XH1/LufqFonpfTFw 76+A== X-Gm-Message-State: AOAM532FPWBJCEns4LHcfPkrn1k8ydQvVZIkIH67AfNyYQUI1OWpy/Te mU68K1CvDVHTQgKBOjdDmnUrwg== X-Received: by 2002:a63:540b:: with SMTP id i11mr33172485pgb.44.1620773553616; Tue, 11 May 2021 15:52:33 -0700 (PDT) Received: from localhost ([2620:15c:202:201:f1d7:673a:456e:c653]) by smtp.gmail.com with UTF8SMTPSA id x22sm14230968pfa.24.2021.05.11.15.52.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 May 2021 15:52:33 -0700 (PDT) From: Matthias Kaehlcke To: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand Cc: Michal Simek , devicetree@vger.kernel.org, Douglas Anderson , linux-usb@vger.kernel.org, Peter Chen , linux-kernel@vger.kernel.org, Stephen Boyd , Ravi Chandra Sadineni , Krzysztof Kozlowski , Bastien Nocera , Matthias Kaehlcke , Rob Herring Subject: [PATCH v10 3/5] of/platform: Add stubs for of_platform_device_create/destroy() Date: Tue, 11 May 2021 15:52:21 -0700 Message-Id: <20210511155152.v10.3.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid> X-Mailer: git-send-email 2.31.1.607.g51e8a6a459-goog In-Reply-To: <20210511225223.550762-1-mka@chromium.org> References: <20210511225223.550762-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 Acked-by: Rob Herring --- Changes in v10: - none Changes in v9: - added Rob's 'Acked-by' tag 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.607.g51e8a6a459-goog