[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201020071158.GC28746@yilunxu-OptiPlex-7050>
Date: Tue, 20 Oct 2020 15:11:58 +0800
From: Xu Yilun <yilun.xu@...el.com>
To: Tom Rix <trix@...hat.com>
Cc: mdf@...nel.org, linux-fpga@...r.kernel.org,
linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
lgoncalv@...hat.com, hao.wu@...el.com
Subject: Re: [PATCH 1/2] fpga: dfl: add driver_override support
> >>> int __dfl_driver_register(struct dfl_driver *dfl_drv, struct module *owner)
> >>> {
> >>> - if (!dfl_drv || !dfl_drv->probe || !dfl_drv->id_table)
> >>> + if (!dfl_drv || !dfl_drv->probe)
> >> id_table is still needed for the normal case.
> >>
> >> Instead of removing this check, could you add something like
> >>
> >> || (!dfl_drv->is_override && !dfl_drv->id_table)
> > I don't think it is needed. Seems is_override and !id_table are duplicated
> > conditions for this implementation. And it may make confusing, e.g. could
> > a driver been force matched when is_override is not set?
> >
> > I think we could make it simple, if the dfl driver didn't provide the
> > id_table, normally it could not match any device. I think it could be
> > easily understood by dfl driver developers.
> >
> Then an ASSERT should be added in dfl_bus_match() for id_entry.
I didn't get your idea. What Assertion should be added for id_entry?
BUG_ON(id_entry == NULL)? Then dfl-uio-pdev can't be inserted before
driver_override is set.
I think it is normal case that a driver is successfully registered but
doesn't match any device because it provides no id_table.
Thanks,
Yilun.
Powered by blists - more mailing lists