Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp771010iol; Thu, 9 Jun 2022 13:41:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKbqefKTE73R3RqpGtcfKnAVlGNy7BkQfh1/Qj2SoLVsCcgeohULhBBk0bLtOBoT9qZENW X-Received: by 2002:a17:906:c10:b0:6f4:6c70:b00f with SMTP id s16-20020a1709060c1000b006f46c70b00fmr37608687ejf.660.1654807297933; Thu, 09 Jun 2022 13:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654807297; cv=none; d=google.com; s=arc-20160816; b=kHro7EushNkunuv3ZEglqs8QqrvszzeKn5af9qiIqMLWFqiwA3rNRpVVv8RwFYpLOX LIHPyssVSvk2sQLkiDOIP08b8I+UL01Ssrk0GxM9HPY9RzFHrIrLs7CZDklM5eedQEIY vxVGKkISkqZjcogpyDoe+IgTQLkjZ7PwfLlm4uiJeytkvmJnff6ZWqwnqshrqITvPs0b 8HdjZnt8A/QRLELBIglJ0fGbUt+wcNXvB5zr4apSYpBTmXZOKA9yDiZ0ZJKJ2N8fvzTz yabrApPmZvcRMxvrK4P7aCpb7qloSyn7WIBTQYTKesg0YrdWbag1wPp4ow7Pes456tzE WBvQ== 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=vLKCtH9TakuUqk54EpzoBPA1XDOnud2z5RmTIYy238A=; b=VsnKY9WZ+TGS4hBN9KsdrPafDOp64yefzAN0Qm9iTmOdS1BoWRVLrcYXmNeRyqJ7XB TrNG2MtuCuSbqe9vnIWjMnw6DWiDvj3L5kOSuc2Mn5JsQzHVZA5J0af7BrhRSUQi7TxI A6ZuQnFGi/+eglfSnaiCjIPMJzfbmfDk7F9k0nn8aIF6Zcw0JYTVIr1bPvxhq3EexVPX Wn93Om6t5rNJY8ZNSsiOa7d6PRbwMWohntOJInO3mvIJORavYKS7xMqN/1xXk2+bJwy/ SRm12TP6oUHhFBXopvH5UvJruZagqeSBPYkHkCaPnfpO4YBfcXTzabMi4LlABiX060Bi vDEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=a9YEBJkA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr20-20020a170906d55400b00709614ead06si21100329ejc.896.2022.06.09.13.41.11; Thu, 09 Jun 2022 13:41:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=a9YEBJkA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1344542AbiFITUP (ORCPT + 99 others); Thu, 9 Jun 2022 15:20:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245512AbiFITUI (ORCPT ); Thu, 9 Jun 2022 15:20:08 -0400 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 AFB7831753A for ; Thu, 9 Jun 2022 12:20:06 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id w13-20020a17090a780d00b001e8961b355dso201968pjk.5 for ; Thu, 09 Jun 2022 12:20:06 -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=vLKCtH9TakuUqk54EpzoBPA1XDOnud2z5RmTIYy238A=; b=a9YEBJkAz+xoaA4KVG/no6vZRzslKfjP87zE2WiwftU0netMy/IOrBH+COySZOnOdZ kD02vfMs8GkeyURwr7jGS/yfEPatFqq2pvvy71avWykoZYUNCbS43FLL/B1j1/0TCwy8 j4gIYlL1dgndj27LC0d/rZcMNy0VnPRUczHPo= 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=vLKCtH9TakuUqk54EpzoBPA1XDOnud2z5RmTIYy238A=; b=xlFkLA18qltdwoepo1hYEkd8iyP4eoFVqu3yhfS3PopPm0HvvoYU4TbWrMKqDgAj7t cCVRD59l7bZNsP7OBYpCRZbbACSonH0yYyvLKwhppDCIA0Nxh2MTiYsqmtQltoUljSMg pQmlFCzMQ6vcIgioETpD48EEYfnSgiw5b2OLFuXobTpbg7iOwBuk9n0a8YrYeIu2Y0V8 7BZM1Tt4zfMsg5LLuFjQTEX+itIDdiFSERAclvxKLJuaIVjCsk9RjgOsij4Et0M/6cOl yGYOV4BosR8NNj2RwSmoZ9Hmmv77zdqwEai56SubBvWQqNIUU8eDiLlDTxErRHbxh1mf kKdA== X-Gm-Message-State: AOAM532ELFaNR2hN5M0Pz05TQu/og3eSB1fJfiqY0bN3u0XA3m+z1xaa P/p0RR5ObpRnd0tj2PmkoIggww== X-Received: by 2002:a17:90a:740e:b0:1e2:a631:87e6 with SMTP id a14-20020a17090a740e00b001e2a63187e6mr4873261pjg.115.1654802406094; Thu, 09 Jun 2022 12:20:06 -0700 (PDT) Received: from localhost ([2620:15c:11a:202:c543:2c9:1206:951b]) by smtp.gmail.com with UTF8SMTPSA id z8-20020a1709027e8800b00163d8d9aefcsm17092404pla.80.2022.06.09.12.20.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Jun 2022 12:20:05 -0700 (PDT) From: Matthias Kaehlcke To: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand , Mathias Nyman , Felipe Balbi Cc: Michal Simek , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Stephen Boyd , devicetree@vger.kernel.org, Bastien Nocera , Peter Chen , Ravi Chandra Sadineni , Roger Quadros , Douglas Anderson , linux-usb@vger.kernel.org, Matthias Kaehlcke , Rob Herring Subject: [PATCH v22 1/3] of/platform: Add stubs for of_platform_device_create/destroy() Date: Thu, 9 Jun 2022 12:19:58 -0700 Message-Id: <20220609121838.v22.1.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog In-Reply-To: <20220609192000.990763-1-mka@chromium.org> References: <20220609192000.990763-1-mka@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson --- Changes in v22: - none 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, -- 2.36.1.476.g0c4daa206d-goog