summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2019-10-16 17:45:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-13 14:09:48 +0300
commite962cd9cf9cfb1f5db6bbad6a6470e5ccf56e290 (patch)
tree6b37624adfdbfb80e7659ebb32160117a2fc4cfd /drivers
parentc059d579961d62c1a675cb89ef799902e6bce815 (diff)
downloadlinux-e962cd9cf9cfb1f5db6bbad6a6470e5ccf56e290.tar.xz
parport: do not check portlist when using device-model
We do not need to maintain a list of ports when we are using the device-model. The base layer is going to maintain the list for us and we can get the list of ports just using bus_for_each_dev(). Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Link: https://lore.kernel.org/r/20191016144540.18810-2-sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/parport/share.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index 7b4ee33c1935..96538b7975e5 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -266,9 +266,6 @@ static int port_check(struct device *dev, void *dev_drv)
int __parport_register_driver(struct parport_driver *drv, struct module *owner,
const char *mod_name)
{
- if (list_empty(&portlist))
- get_lowlevel_driver();
-
if (drv->devmodel) {
/* using device model */
int ret;
@@ -292,6 +289,8 @@ int __parport_register_driver(struct parport_driver *drv, struct module *owner,
drv->devmodel = false;
+ if (list_empty(&portlist))
+ get_lowlevel_driver();
mutex_lock(&registration_lock);
list_for_each_entry(port, &portlist, list)
drv->attach(port);