lkml.org 
[lkml]   [2005]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] ns558 bug
ambx1@neo.rr.com (Adam Belay) wrote:
>
> It looks ok. My only concern is what would happen if the isa probe succeded
> but the pnp_register_driver failed? "pnp_register_driver" return -ENODEV if
> "CONFIG_PNP" isn't enabled. Do you think this would conflict with legacy
> probing?

Fair enough. How about this?

static void ns588_unregister_ports(void)
{
struct ns558 *port;

list_for_each_entry(port, &ns558_list, node) {
gameport_unregister_port(&port->gameport);
switch (port->type) {

#ifdef CONFIG_PNP
case NS558_PNP:
/* fall through */
#endif
case NS558_ISA:
release_region(port->gameport.io &
~(port->size - 1), port->size);
kfree(port);
break;

default:
break;
}
}
}

static int __init ns558_init(void)
{
int i = 0;
int ret;

/*
* Probe for ISA ports.
*/

while (ns558_isa_portlist[i])
ns558_isa_probe(ns558_isa_portlist[i++]);

ret = pnp_register_driver(&ns558_pnp_driver);
if (ret < 0) {
ns588_unregister_ports();
return ret;
}
return 0;
}

static void __exit ns558_exit(void)
{
ns588_unregister_ports();
pnp_unregister_driver(&ns558_pnp_driver);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.054 / U:2.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site