On 2/28/20 1:34 AM, Greg KH wrote:
On Thu, Feb 27, 2020 at 04:32:00PM -0600, Pierre-Louis Bossart wrote:
+static struct sdw_master_driver intel_sdw_driver = {
+ .driver = {
+ .name = "intel-master",
+ .owner = THIS_MODULE,
Nit, setting .owner isn't needed anymore, as the core code handles this
for you, right?
Ah, yes indeed, the following code takes care of it. Thanks for spotting
this!
I can remove this assignment in a follow-up patch if that's alright with
Vinod.
+#define sdw_register_master_driver(drv) \
+ __sdw_register_master_driver(drv, THIS_MODULE)
+/**
+ * __sdw_register_master_driver() - register a SoundWire Master driver
+ * @mdrv: 'Master driver' to register
+ * @owner: owning module/driver
+ *
+ * Return: zero on success, else a negative error code.
+ */
+int __sdw_register_master_driver(struct sdw_master_driver *mdrv,
+ struct module *owner)
+{
+ mdrv->driver.bus = &sdw_bus_type;
+
+ if (!mdrv->probe) {
+ pr_err("driver %s didn't provide SDW probe routine\n",
+ mdrv->driver.name);
+ return -EINVAL;
+ }
+
+ mdrv->driver.owner = owner;