Skip to content

Commit

Permalink
parport: do not check portlist when using device-model
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
sudipm-mukherjee authored and gregkh committed Nov 13, 2019
1 parent c059d57 commit e962cd9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/parport/share.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit e962cd9

Please sign in to comment.