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: Wu Hao <hao.wu@intel.com> Acked-by: Moritz Fischer <mdf@kernel.org> Signed-off-by: Moritz Fischer <mdf@kernel.org>
This commit is contained in:
parent
af9ca4b0bd
commit
84b693e378
|
@ -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;
|
||||
|
||||
ret = drv->ops->init(pdev, feature);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (drv->ops->init) {
|
||||
ret = drv->ops->init(pdev, feature);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
feature->ops = drv->ops;
|
||||
|
||||
|
|
Loading…
Reference in New Issue