Commit 84b693e3 authored by Wu Hao's avatar Wu Hao Committed by Moritz Fischer

fpga: dfl: make init callback optional

This patch makes init callback of sub features optional. With
this change, people don't need to prepare any empty init callback.
Signed-off-by: default avatarWu Hao <hao.wu@intel.com>
Acked-by: default avatarMoritz Fischer <mdf@kernel.org>
Signed-off-by: default avatarMoritz Fischer <mdf@kernel.org>
parent af9ca4b0
...@@ -271,11 +271,13 @@ static int dfl_feature_instance_init(struct platform_device *pdev, ...@@ -271,11 +271,13 @@ static int dfl_feature_instance_init(struct platform_device *pdev,
struct dfl_feature *feature, struct dfl_feature *feature,
struct dfl_feature_driver *drv) struct dfl_feature_driver *drv)
{ {
int ret; int ret = 0;
if (drv->ops->init) {
ret = drv->ops->init(pdev, feature); ret = drv->ops->init(pdev, feature);
if (ret) if (ret)
return ret; return ret;
}
feature->ops = drv->ops; feature->ops = drv->ops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment