From patchwork Mon Jul 19 22:21:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 1507327 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org 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=) Authentication-Results: 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=kRPPvmFX; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4GTJmm2Hs1z9sV8 for ; Tue, 20 Jul 2021 10:02:16 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244144AbhGSXVS (ORCPT ); Mon, 19 Jul 2021 19:21:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359376AbhGSVnw (ORCPT ); Mon, 19 Jul 2021 17:43:52 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEA3FC0613B1 for ; Mon, 19 Jul 2021 15:21:37 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id g4-20020a17090ace84b029017554809f35so730075pju.5 for ; Mon, 19 Jul 2021 15:21:37 -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=g1VUsyo7cljMbwFDieYIV5JeeNR2RlcZC3D27A3qHS0=; b=kRPPvmFXE5Mgwv6tfnWkE5muTpKYOVG1GPrtHQPkNg2Uq0mHyjN4wTBe/SvY0sQ5mr KOdfbofNj2wonIXBN43Pd7ACr4mRptJj5t/etiPE7pqSGb7BS5oMCCWb6K1/kFb8FaaR MHpVWaFE87Fz4kpxPfwaO09iOE9M8MaFvBue4= 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=g1VUsyo7cljMbwFDieYIV5JeeNR2RlcZC3D27A3qHS0=; b=N8k+EufVel6OoZnLGBRP/Zc2CWnBHkIasaWJwz8ZmpgV7+qauE+L32qru5I91euXPG UYTDuMdw/K6C1o7z+MH6akegb57rVJJRW0Pv8G5HJ141uJGKZoFbRcAH/3hnggXH7S6Q +DNUxSV/siHtQQu3+1edjdhYQ1+F9mpidlMkO4BS8pLc4vn2H/98X/kS/A4Niwyw3fYs TPflvULT9vY22hDkgKvJZUHfc9KUxuoF6UVpJrI880WweL323+QQwPiH3aTLXzEBdEQT hG2sKGsijnR9QAaL6fZfKPLHbTCCyjAI0hABRnVyPXNkQ9XEzoXqeSiBEmjUcJigBv8U HaRg== X-Gm-Message-State: AOAM530buCwCXcpLAfoV/TlfSLop1uFwAbNoie313uFG3qJEgfAwhqUt LHHFElZW2asb8Z9LG8xyc03ctQ== X-Google-Smtp-Source: ABdhPJxNEIIx43kLmIxC13TtCzAy+cwH4DSRv1ugrH0M+JFDIXzpmvYBZJWXHwJo/0jMChy783KZ4g== X-Received: by 2002:a17:90a:8c9:: with SMTP id 9mr31381363pjn.58.1626733297505; Mon, 19 Jul 2021 15:21:37 -0700 (PDT) Received: from localhost ([2620:15c:202:201:4d0:bf5f:b8cd:2d67]) by smtp.gmail.com with UTF8SMTPSA id nl2sm17351924pjb.10.2021.07.19.15.21.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Jul 2021 15:21:37 -0700 (PDT) From: Matthias Kaehlcke To: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand , Mathias Nyman , Felipe Balbi Cc: Michal Simek , linux-usb@vger.kernel.org, Peter Chen , Bastien Nocera , Douglas Anderson , Stephen Boyd , devicetree@vger.kernel.org, Krzysztof Kozlowski , linux-kernel@vger.kernel.org, Ravi Chandra Sadineni , Matthias Kaehlcke , Rob Herring Subject: [PATCH v14 2/6] of/platform: Add stubs for of_platform_device_create/destroy() Date: Mon, 19 Jul 2021 15:21:24 -0700 Message-Id: <20210719152055.v14.2.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid> X-Mailer: git-send-email 2.32.0.402.g57bb445576-goog In-Reply-To: <20210719222128.4122837-1-mka@chromium.org> References: <20210719222128.4122837-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 --- 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,