Commit 99035e99 authored by Thierry Reding's avatar Thierry Reding

drm/dsi: Do not require .owner field to be set

Drivers now no longer need to set the .owner field. It will be
automatically set at registration time.
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 3ef05924
...@@ -887,14 +887,18 @@ static void mipi_dsi_drv_shutdown(struct device *dev) ...@@ -887,14 +887,18 @@ static void mipi_dsi_drv_shutdown(struct device *dev)
} }
/** /**
* mipi_dsi_driver_register() - register a driver for DSI devices * mipi_dsi_driver_register_full() - register a driver for DSI devices
* @drv: DSI driver structure * @drv: DSI driver structure
* @owner: owner module
* *
* Return: 0 on success or a negative error code on failure. * Return: 0 on success or a negative error code on failure.
*/ */
int mipi_dsi_driver_register(struct mipi_dsi_driver *drv) int mipi_dsi_driver_register_full(struct mipi_dsi_driver *drv,
struct module *owner)
{ {
drv->driver.bus = &mipi_dsi_bus_type; drv->driver.bus = &mipi_dsi_bus_type;
drv->driver.owner = owner;
if (drv->probe) if (drv->probe)
drv->driver.probe = mipi_dsi_drv_probe; drv->driver.probe = mipi_dsi_drv_probe;
if (drv->remove) if (drv->remove)
...@@ -904,7 +908,7 @@ int mipi_dsi_driver_register(struct mipi_dsi_driver *drv) ...@@ -904,7 +908,7 @@ int mipi_dsi_driver_register(struct mipi_dsi_driver *drv)
return driver_register(&drv->driver); return driver_register(&drv->driver);
} }
EXPORT_SYMBOL(mipi_dsi_driver_register); EXPORT_SYMBOL(mipi_dsi_driver_register_full);
/** /**
* mipi_dsi_driver_unregister() - unregister a driver for DSI devices * mipi_dsi_driver_unregister() - unregister a driver for DSI devices
......
...@@ -1052,7 +1052,6 @@ static struct mipi_dsi_driver s6e8aa0_driver = { ...@@ -1052,7 +1052,6 @@ static struct mipi_dsi_driver s6e8aa0_driver = {
.remove = s6e8aa0_remove, .remove = s6e8aa0_remove,
.driver = { .driver = {
.name = "panel_s6e8aa0", .name = "panel_s6e8aa0",
.owner = THIS_MODULE,
.of_match_table = s6e8aa0_of_match, .of_match_table = s6e8aa0_of_match,
}, },
}; };
......
...@@ -966,7 +966,6 @@ static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi) ...@@ -966,7 +966,6 @@ static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
static struct mipi_dsi_driver panel_simple_dsi_driver = { static struct mipi_dsi_driver panel_simple_dsi_driver = {
.driver = { .driver = {
.name = "panel-simple-dsi", .name = "panel-simple-dsi",
.owner = THIS_MODULE,
.of_match_table = dsi_of_match, .of_match_table = dsi_of_match,
}, },
.probe = panel_simple_dsi_probe, .probe = panel_simple_dsi_probe,
......
...@@ -245,9 +245,13 @@ static inline void mipi_dsi_set_drvdata(struct mipi_dsi_device *dsi, void *data) ...@@ -245,9 +245,13 @@ static inline void mipi_dsi_set_drvdata(struct mipi_dsi_device *dsi, void *data)
dev_set_drvdata(&dsi->dev, data); dev_set_drvdata(&dsi->dev, data);
} }
int mipi_dsi_driver_register(struct mipi_dsi_driver *driver); int mipi_dsi_driver_register_full(struct mipi_dsi_driver *driver,
struct module *owner);
void mipi_dsi_driver_unregister(struct mipi_dsi_driver *driver); void mipi_dsi_driver_unregister(struct mipi_dsi_driver *driver);
#define mipi_dsi_driver_register(driver) \
mipi_dsi_driver_register_full(driver, THIS_MODULE)
#define module_mipi_dsi_driver(__mipi_dsi_driver) \ #define module_mipi_dsi_driver(__mipi_dsi_driver) \
module_driver(__mipi_dsi_driver, mipi_dsi_driver_register, \ module_driver(__mipi_dsi_driver, mipi_dsi_driver_register, \
mipi_dsi_driver_unregister) mipi_dsi_driver_unregister)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment