From patchwork Fri Aug 4 06:09:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 109373 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp1738270qge; Thu, 3 Aug 2017 23:09:36 -0700 (PDT) X-Received: by 10.98.18.11 with SMTP id a11mr1320987pfj.116.1501826975907; Thu, 03 Aug 2017 23:09:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501826975; cv=none; d=google.com; s=arc-20160816; b=T7Y+l/HQP9iZrA+xEO+Vrf5WIa1yNRSzOeg3t8wHHaVjeXsi/ihLk7aVEXsWTqTWIH +tQxkrnwwqLf1v57b2PKbSa8ovSh3Nplyo5ABx+yWC3DW6Wl+pGspLbMZ/MfQcpKFR2m eszpISVBzKCDb/q5tk+LH3lG3WBA2DSVUOl/8m2C2KRr85eVKNVY1dWd0nzd0mJlleKM pA0w3T1JV/V/R8dGSNaUvGteVYyRFZGiFLyTibHSTcq1a8ge4jELtqDJGP28z9LRDn4B Pte+7tccltKsA91JY/i00NY3vwgreXLJCWgdKy1BPkNzpACK8Z8vvw2GPH+LUgp5dPHh k5iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Z8uSxRi7ozgwl1GkOiW0oLxX91AHaQrUU9pez7Tf6LA=; b=I3g3diPLwlmW6OB7sqcRFPhzyFfX92P+9lBfN84QQE6gEwd9hRqYz4XW9KyIHsgFI2 2FmqQS5UAW0pXOGz7NhTIMJZOFWXI+u8jtfNxiZCFjXJRfiJyyXbV2meC2ZpwtnkwiB1 BvioI3Y2hpXVf9w9/udzlDqujNPhhdUOTa4MiEDHWHU00toBE5ZbLOI6t9tvv/BEYzNt wr4xSg80AZkmHPO+U6Qy1XX42d8gQFMEdvDvYKWiKIIx4+IcY8PyapPkHTH4HXo26HJ7 Kuw7IH+UyJ1gYJ0wgk4s+kMtAKBtFZRpdHTxGSL8fmv6bMScmILEtYclwWO7Ps+s10QI pV8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=a5wlbG7z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 191si522131pgd.520.2017.08.03.23.09.35; Thu, 03 Aug 2017 23:09:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=a5wlbG7z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751383AbdHDGJ2 (ORCPT + 25 others); Fri, 4 Aug 2017 02:09:28 -0400 Received: from mail-pg0-f50.google.com ([74.125.83.50]:38101 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751298AbdHDGJ0 (ORCPT ); Fri, 4 Aug 2017 02:09:26 -0400 Received: by mail-pg0-f50.google.com with SMTP id l64so3990650pge.5 for ; Thu, 03 Aug 2017 23:09:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Z8uSxRi7ozgwl1GkOiW0oLxX91AHaQrUU9pez7Tf6LA=; b=a5wlbG7zFyI1pb8KUmNsIyEaU7BTN5b40iwxOoLUYJBArC6Thu2W4Nvt94W8UYc/Q7 LVyAduhaK2ZqdmwqRhI6vvnxKv+Mrk6LPpNqhLqYZzz78Sj6st9Gh9D+bkig5SMFM/5V 08MTOkd3/NyQILidL9WaD8OTiRrIfODp5L6sE= 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; bh=Z8uSxRi7ozgwl1GkOiW0oLxX91AHaQrUU9pez7Tf6LA=; b=FicOwatVjlZbx2eSh/MKomufjq1z8mpqBHG0KNjozorANJFDi+WNFUzBJBzKzGJAo7 jihrAmYnPJXDdOjd9zQeuRepUIjWQFnlDtsIQHXVwda6ovJZu3/TzafXenXKLEPODS+H 3nmYXEFugnzqhohJmEG3JVePYUnHQ44mbHcN3n86YIUdWz9XZjMT9NmLj0PPrMMig70o HUNE6fg0sANs8vOMOB8IYJ3iKdRMCoXwVJIQaBnQ+t1oOcmostriy9/vcVGlFVhB4oMF QS4J4Nt62NxdaCbC3jffJyZfXcPS4KIYtxTTNzpBXn82HhwVErG1KBVaLlPU1wBy1lGi PmxQ== X-Gm-Message-State: AIVw113MZ9WwQZz9JQaH6DYx55qqJMfCCrv3hAWsZXGil3R4UFZVtyJY KTn4YnbFekxer6CD X-Received: by 10.84.241.76 with SMTP id u12mr1480421plm.196.1501826966151; Thu, 03 Aug 2017 23:09:26 -0700 (PDT) Received: from localhost ([122.171.226.174]) by smtp.gmail.com with ESMTPSA id f88sm1304167pff.74.2017.08.03.23.09.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Aug 2017 23:09:24 -0700 (PDT) From: Viresh Kumar To: Rob Herring , Frank Rowand Cc: Viresh Kumar , Vincent Guittot , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] of: platform: Create dummy routines for !CONFIG_OF_ADDRESS Date: Fri, 4 Aug 2017 11:39:19 +0530 Message-Id: X-Mailer: git-send-email 2.13.0.71.gd7076ec9c9cb Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Few routines don't have their dummy counterparts which results in build failures where these routines are used without CONFIG_OF_ADDRESS enabled. Fix those by defining the dummy versions. Signed-off-by: Viresh Kumar --- include/linux/of_platform.h | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) -- 2.13.0.71.gd7076ec9c9cb diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index e0d1946270f3..e8d93a5e3ddd 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -52,12 +52,13 @@ struct of_dev_auxdata { .platform_data = _pdata } extern const struct of_device_id of_default_bus_match_table[]; +extern struct platform_device *of_find_device_by_node(struct device_node *np); +#ifdef CONFIG_OF_ADDRESS /* Platform drivers register/unregister */ extern struct platform_device *of_device_alloc(struct device_node *np, const char *bus_id, struct device *parent); -extern struct platform_device *of_find_device_by_node(struct device_node *np); /* Platform devices and busses creation */ extern struct platform_device *of_platform_device_create(struct device_node *np, @@ -68,7 +69,6 @@ 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, @@ -82,6 +82,33 @@ extern int devm_of_platform_populate(struct device *dev); extern void devm_of_platform_depopulate(struct device *dev); #else +static inline struct platform_device * +of_device_alloc(struct device_node *np, const char *bus_id, + struct device *parent) +{ + return NULL; +} + +/* 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_bus_probe(struct device_node *root, + const struct of_device_id *matches, + struct device *parent) +{ + return -ENODEV; +} + static inline int of_platform_populate(struct device_node *root, const struct of_device_id *matches, const struct of_dev_auxdata *lookup,