From patchwork Wed Jan 19 20:43:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 1581926 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=LI8MsXwP; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4JfHgB34XFz9sXM for ; Thu, 20 Jan 2022 07:44:06 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244899AbiASUoB (ORCPT ); Wed, 19 Jan 2022 15:44:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245128AbiASUn4 (ORCPT ); Wed, 19 Jan 2022 15:43:56 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 264E0C06161C for ; Wed, 19 Jan 2022 12:43:56 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id s9so1457064plg.7 for ; Wed, 19 Jan 2022 12:43:56 -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=aBnCws/J3yBxLfvHdmXmyJWct69R9h+zMBJizT7ymik=; b=LI8MsXwP6awx7ie331rc+M//CIaQKd7Sbys1Vv8djTWUsR5zeh2GmMWegZiYOVGO7E 2k8wlMfUD0MDm2XKnDqPuVtyeKTnX3a28GUDZKSbLLWkjYfpXCHtyCKa1Y1R7Gp54+x/ rMGFADBaNG5iW00VpVp2MXt/uY0v0cxys+49w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aBnCws/J3yBxLfvHdmXmyJWct69R9h+zMBJizT7ymik=; b=PBq1kzyNBh7PoD6Vdyfbsfobg6V4dxTZmtqTPWsNgYiBRiur+HlmRhw62qlHmTOFcz i+lG6Rpxeq3aEmEISF/l7jlp9BIdpcHNveUz17OjtXA9gSBfVXrYD9TUJQnrO/82xlCZ dDv7WIuvII+VYhrnfI51fIY99OvDKCdrLvByySov34fedkfsBcs7mjEJoaz9CuOfrUy6 zUE523ivCjhlcfHBWIP1FOMSdJB9osrwaaq15b6cCF6Geqj1Lt4JjGR1D4b5vu3DbgYp /aI0Pe3oP4o6eZoIkcJe2588VdPTRTnjs1zTf94+mpm+U6VZjOAfjhfU9AH4ieFx+CVa UBOA== X-Gm-Message-State: AOAM530lDdL7mGbx+W/avRIqRCuVwyoASHOih2vrfOo5QbZKNkC3G6eC bVX84dh+OZnO79f+69Q1lPgiPQ== X-Google-Smtp-Source: ABdhPJx+zRc6bwKkaYZ7xovg+TNn+XW/iI9YRIYuNg0xSIA9m43wEYyw/ph226fLEyRw+WF2mQVG6g== X-Received: by 2002:a17:903:52:b0:14a:4951:390a with SMTP id l18-20020a170903005200b0014a4951390amr34871511pla.54.1642625035702; Wed, 19 Jan 2022 12:43:55 -0800 (PST) Received: from localhost ([2620:15c:202:201:618e:efc:c014:d89c]) by smtp.gmail.com with UTF8SMTPSA id x18sm478531pgj.41.2022.01.19.12.43.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Jan 2022 12:43:55 -0800 (PST) From: Matthias Kaehlcke To: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand , Mathias Nyman , Felipe Balbi Cc: devicetree@vger.kernel.org, Krzysztof Kozlowski , Stephen Boyd , Peter Chen , linux-kernel@vger.kernel.org, Douglas Anderson , Roger Quadros , Michal Simek , linux-usb@vger.kernel.org, Bastien Nocera , Ravi Chandra Sadineni , Matthias Kaehlcke , Rob Herring Subject: [PATCH v20 1/5] of/platform: Add stubs for of_platform_device_create/destroy() Date: Wed, 19 Jan 2022 12:43:41 -0800 Message-Id: <20220119124327.v20.1.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid> X-Mailer: git-send-email 2.34.1.703.g22d0c6ccf7-goog In-Reply-To: <20220119204345.3769662-1-mka@chromium.org> References: <20220119204345.3769662-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_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 Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson --- Changes in v20: - added 'Reviewed-by' tags from Stephen and Doug Changes in v19: - still no changes ... Changes in v18: - still no changes ... Changes in v17: - none Changes in v16: - none Changes in v15: - none Changes in v14: - none Changes in v13: - none Changes in v12: - none Changes in v11: - none 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,