From patchwork Thu Feb 17 18:42:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 543682 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B709C4332F for ; Thu, 17 Feb 2022 18:43:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244526AbiBQSnX (ORCPT ); Thu, 17 Feb 2022 13:43:23 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244520AbiBQSnW (ORCPT ); Thu, 17 Feb 2022 13:43:22 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27AC1E034 for ; Thu, 17 Feb 2022 10:43:07 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id om7so6424023pjb.5 for ; Thu, 17 Feb 2022 10:43:07 -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=6IUCcm+Xv8CevqetI7u2KdRt47l5psRZKi3kkjgGmu4=; b=D5qGn9RS8fKps1ygiiiA7oCQ2S6DH/tdHqBGidSFqAx6pfr+S0uf0j0jpEENFsiyoJ Hv13aj3rT1LldQa0Z6HY7kIVb0v47q8ZgYP/tL3ZPV6yUb6yg7tL7hCRTugRJgoWzBUJ PM7ydl5Ib1PJH/SGFfCd1zpkTSdOwp/dC/bqw= 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=6IUCcm+Xv8CevqetI7u2KdRt47l5psRZKi3kkjgGmu4=; b=tNIi9JsOGKk/eXjdM34sQikY9qA8E7K5KaZk8+jypcO0eUyS2A0dIZgWMK3gH00rgM h0Cjp/C4t70VWYws9wFUNjwODFogoJATmlMee8G3wBmi0IAxbFsOD+ePHB/w8EHg933f aUC9loLIbSLF+VNKrtzixPhVIItSHKLWZQUG61abcxDUBVmuc6TZgBNSRFpBeQ9ltA75 X/WGHEVcpSaTIAKXA6wzCaZ/TxLS3345Mgm7T+sBLQvzXHBDGgbjjRwkZxT0Z3wmNR70 GPa6TEktLu8bDEnXkRn9PtxS3nM1vQHR4uVW3gNea4jIXS+t5JiyJ8Uc2BTbYCmtER8c jtSw== X-Gm-Message-State: AOAM533InB0wksg+UcuvgjQjzFRmCv98QX1oAVQahRbOpVgYvc2/blxf nDJolY+t7PDXWP8ddSOE3BKsUg== X-Google-Smtp-Source: ABdhPJwxXLV76Yfk3oRUaeH9SCUlA4Jogb+q7Sy+2Pc7si2QBPYdC6e6Wk6BIy7AjeATNqnWXDOXVA== X-Received: by 2002:a17:902:ce11:b0:14a:a6aa:4fa6 with SMTP id k17-20020a170902ce1100b0014aa6aa4fa6mr3948885plg.149.1645123386679; Thu, 17 Feb 2022 10:43:06 -0800 (PST) Received: from localhost ([2620:15c:202:201:b42d:98cc:5dcc:5ef5]) by smtp.gmail.com with UTF8SMTPSA id c23sm296081pfi.136.2022.02.17.10.43.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 10:43:06 -0800 (PST) From: Matthias Kaehlcke To: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand , Mathias Nyman , Felipe Balbi Cc: linux-usb@vger.kernel.org, Ravi Chandra Sadineni , Roger Quadros , linux-kernel@vger.kernel.org, Bastien Nocera , Douglas Anderson , Michal Simek , Stephen Boyd , devicetree@vger.kernel.org, Krzysztof Kozlowski , Peter Chen , Matthias Kaehlcke , Rob Herring Subject: [PATCH v21 1/3] of/platform: Add stubs for of_platform_device_create/destroy() Date: Thu, 17 Feb 2022 10:42:52 -0800 Message-Id: <20220217104219.v21.1.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid> X-Mailer: git-send-email 2.35.1.473.g83b2b277ed-goog In-Reply-To: <20220217184254.4141705-1-mka@chromium.org> References: <20220217184254.4141705-1-mka@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 v21: - none 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,