-----Original Message----- From: Leon Romanovsky leon@kernel.org Sent: Tuesday, October 6, 2020 10:03 AM To: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Cc: Ertman, David M david.m.ertman@intel.com; alsa-devel@alsa- project.org; parav@mellanox.com; tiwai@suse.de; netdev@vger.kernel.org; ranjani.sridharan@linux.intel.com; fred.oh@linux.intel.com; linux- rdma@vger.kernel.org; dledford@redhat.com; broonie@kernel.org; jgg@nvidia.com; gregkh@linuxfoundation.org; kuba@kernel.org; Williams, Dan J dan.j.williams@intel.com; Saleem, Shiraz shiraz.saleem@intel.com; davem@davemloft.net; Patil, Kiran kiran.patil@intel.com Subject: Re: [PATCH v2 1/6] Add ancillary bus support
On Tue, Oct 06, 2020 at 10:18:07AM -0500, Pierre-Louis Bossart wrote:
Thanks for the review Leon.
[...]
+EXPORT_SYMBOL_GPL(__ancillary_device_add);
+static int ancillary_probe_driver(struct device *dev) +{
- struct ancillary_driver *ancildrv = to_ancillary_drv(dev->driver);
- struct ancillary_device *ancildev = to_ancillary_dev(dev);
- int ret;
- ret = dev_pm_domain_attach(dev, true);
- if (ret) {
dev_warn(dev, "Failed to attach to PM Domain : %d\n", ret);
return ret;
- }
- ret = ancildrv->probe(ancildev, ancillary_match_id(ancildrv-
id_table, ancildev));
I don't think that you need to call ->probe() if ancillary_match_id() returned NULL and probably that check should be done before dev_pm_domain_attach().
we'll look into this.
AKAIK, this callback is only accessed from the bus subsystem after a successful return from ancillary_match().
-DaveE