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

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
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -271,11 +271,13 @@ static int dfl_feature_instance_init(struct platform_device *pdev,
				     struct dfl_feature *feature,
				     struct dfl_feature_driver *drv)
{
	int ret;
	int ret = 0;

	if (drv->ops->init) {
		ret = drv->ops->init(pdev, feature);
		if (ret)
			return ret;
	}

	feature->ops = drv->ops;