[2/3] remoteproc: add empty remoteproc API functions in header

Message ID 1479834163-30842-1-git-send-email-stanimir.varbanov@linaro.org
State New
Headers show

Commit Message

Stanimir Varbanov Nov. 22, 2016, 5:02 p.m.
With this addition in place the drivers which uses remote
processor APIs will be able to be compile tested on different
architectures with COMPILE_TEST Kconfig option.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

---
 include/linux/remoteproc.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch hide | download patch | download mbox

diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 930023b7c825..a727cb3c9e3d 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -486,6 +486,7 @@  struct rproc_vdev {
 	u32 rsc_offset;
 };
 
+#if IS_ENABLED(CONFIG_REMOTEPROC)
 struct rproc *rproc_get_by_phandle(phandle phandle);
 struct rproc *rproc_alloc(struct device *dev, const char *name,
 			  const struct rproc_ops *ops,
@@ -510,5 +511,28 @@  static inline struct rproc *vdev_to_rproc(struct virtio_device *vdev)
 
 	return rvdev->rproc;
 }
+#else
+static inline struct rproc *
+rproc_get_by_phandle(phandle phandle) { return ERR_PTR(-ENODEV); }
+static inline struct rproc *rproc_alloc(struct device *dev, const char *name,
+					const struct rproc_ops *ops,
+					const char *firmware, int len)
+{ return ERR_PTR(-ENODEV); }
+static inline void rproc_put(struct rproc *rproc) {}
+static inline int rproc_add(struct rproc *rproc) { return -ENODEV; }
+static inline int rproc_del(struct rproc *rproc) { return -ENODEV; }
+static inline void rproc_free(struct rproc *rproc) {}
+
+static inline int rproc_boot(struct rproc *rproc) { return -ENODEV; }
+static inline void rproc_shutdown(struct rproc *rproc) {}
+static inline void
+rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type) {}
+
+static inline struct rproc_vdev *vdev_to_rvdev(struct virtio_device *vdev)
+{ return NULL; }
+
+static inline struct rproc *vdev_to_rproc(struct virtio_device *vdev)
+{ return NULL; }
+#endif
 
 #endif /* REMOTEPROC_H */